1
2
3
4
5
6
7 import sys
8 import getopt
9 import re as re_
10
11 etree_ = None
12 Verbose_import_ = False
13 ( XMLParser_import_none, XMLParser_import_lxml,
14 XMLParser_import_elementtree
15 ) = range(3)
16 XMLParser_import_library = None
17 try:
18
19 from lxml import etree as etree_
20 XMLParser_import_library = XMLParser_import_lxml
21 if Verbose_import_:
22 print("running with lxml.etree")
23 except ImportError:
24 try:
25
26 import xml.etree.cElementTree as etree_
27 XMLParser_import_library = XMLParser_import_elementtree
28 if Verbose_import_:
29 print("running with cElementTree on Python 2.5+")
30 except ImportError:
31 try:
32
33 import xml.etree.ElementTree as etree_
34 XMLParser_import_library = XMLParser_import_elementtree
35 if Verbose_import_:
36 print("running with ElementTree on Python 2.5+")
37 except ImportError:
38 try:
39
40 import cElementTree as etree_
41 XMLParser_import_library = XMLParser_import_elementtree
42 if Verbose_import_:
43 print("running with cElementTree")
44 except ImportError:
45 try:
46
47 import elementtree.ElementTree as etree_
48 XMLParser_import_library = XMLParser_import_elementtree
49 if Verbose_import_:
50 print("running with ElementTree")
51 except ImportError:
52 raise ImportError("Failed to import ElementTree from any known place")
53
62
63
64
65
66
67
68
69
70 try:
71 from generatedssuper import GeneratedsSuper
72 except ImportError:
73
86 values = input_data.split()
87 for value in values:
88 try:
89 fvalue = float(value)
90 except (TypeError, ValueError):
91 raise_parse_error(node, 'Requires sequence of integers')
92 return input_data
100 values = input_data.split()
101 for value in values:
102 try:
103 fvalue = float(value)
104 except (TypeError, ValueError):
105 raise_parse_error(node, 'Requires sequence of floats')
106 return input_data
114 values = input_data.split()
115 for value in values:
116 try:
117 fvalue = float(value)
118 except (TypeError, ValueError):
119 raise_parse_error(node, 'Requires sequence of doubles')
120 return input_data
128 values = input_data.split()
129 for value in values:
130 if value not in ('true', '1', 'false', '0', ):
131 raise_parse_error(node, 'Requires sequence of booleans ("true", "1", "false", "0")')
132 return input_data
134 return instring.lower()
136 path_list = []
137 self.get_path_list_(node, path_list)
138 path_list.reverse()
139 path = '/'.join(path_list)
140 return path
141 Tag_strip_pattern_ = re_.compile(r'\{.*\}')
150 class_obj1 = default_class
151 if 'xsi' in node.nsmap:
152 classname = node.get('{%s}type' % node.nsmap['xsi'])
153 if classname is not None:
154 names = classname.split(':')
155 if len(names) == 2:
156 classname = names[1]
157 class_obj2 = globals().get(classname)
158 if class_obj2 is not None:
159 class_obj1 = class_obj2
160 return class_obj1
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184 ExternalEncoding = 'ascii'
185 Tag_pattern_ = re_.compile(r'({.*})?(.*)')
186 String_cleanup_pat_ = re_.compile(r"[\n\r\s]+")
187 Namespace_extract_pat_ = re_.compile(r'{(.*)}(.*)')
188
189
190
191
192
194 for idx in range(level):
195 outfile.write(' ')
196
198 if not inStr:
199 return ''
200 s1 = (isinstance(inStr, basestring) and inStr or
201 '%s' % inStr)
202 s1 = s1.replace('&', '&')
203 s1 = s1.replace('<', '<')
204 s1 = s1.replace('>', '>')
205 return s1
206
208 s1 = (isinstance(inStr, basestring) and inStr or
209 '%s' % inStr)
210 s1 = s1.replace('&', '&')
211 s1 = s1.replace('<', '<')
212 s1 = s1.replace('>', '>')
213 if '"' in s1:
214 if "'" in s1:
215 s1 = '"%s"' % s1.replace('"', """)
216 else:
217 s1 = "'%s'" % s1
218 else:
219 s1 = '"%s"' % s1
220 return s1
221
223 s1 = inStr
224 if s1.find("'") == -1:
225 if s1.find('\n') == -1:
226 return "'%s'" % s1
227 else:
228 return "'''%s'''" % s1
229 else:
230 if s1.find('"') != -1:
231 s1 = s1.replace('"', '\\"')
232 if s1.find('\n') == -1:
233 return '"%s"' % s1
234 else:
235 return '"""%s"""' % s1
236
237 -def get_all_text_(node):
238 if node.text is not None:
239 text = node.text
240 else:
241 text = ''
242 for child in node:
243 if child.tail is not None:
244 text += child.tail
245 return text
246
248 attrs = node.attrib
249 attr_parts = attr_name.split(':')
250 value = None
251 if len(attr_parts) == 1:
252 value = attrs.get(attr_name)
253 elif len(attr_parts) == 2:
254 prefix, name = attr_parts
255 namespace = node.nsmap.get(prefix)
256 if namespace is not None:
257 value = attrs.get('{%s}%s' % (namespace, name, ))
258 return value
259
260
263
270
271
273
274 CategoryNone = 0
275 CategoryText = 1
276 CategorySimple = 2
277 CategoryComplex = 3
278
279 TypeNone = 0
280 TypeText = 1
281 TypeString = 2
282 TypeInteger = 3
283 TypeFloat = 4
284 TypeDecimal = 5
285 TypeDouble = 6
286 TypeBoolean = 7
287 - def __init__(self, category, content_type, name, value):
294 - def getContenttype(self, content_type):
295 return self.content_type
300 - def export(self, outfile, level, name, namespace):
321 if self.category == MixedContainer.CategoryText:
322 showIndent(outfile, level)
323 outfile.write('model_.MixedContainer(%d, %d, "%s", "%s"),\n' % \
324 (self.category, self.content_type, self.name, self.value))
325 elif self.category == MixedContainer.CategorySimple:
326 showIndent(outfile, level)
327 outfile.write('model_.MixedContainer(%d, %d, "%s", "%s"),\n' % \
328 (self.category, self.content_type, self.name, self.value))
329 else:
330 showIndent(outfile, level)
331 outfile.write('model_.MixedContainer(%d, %d, "%s",\n' % \
332 (self.category, self.content_type, self.name,))
333 self.value.exportLiteral(outfile, level + 1)
334 showIndent(outfile, level)
335 outfile.write(')\n')
336
337
339 - def __init__(self, name='', data_type='', container=0):
340 self.name = name
341 self.data_type = data_type
342 self.container = container
348 if isinstance(self.data_type, list):
349 if len(self.data_type) > 0:
350 return self.data_type[-1]
351 else:
352 return 'xs:string'
353 else:
354 return self.data_type
357
359 if typ is None or value is None:
360 return value
361 return typ(value)
362
363
364
365
366
368 """BundleType is intended to serve as the high-level construct under
369 which all other MAEC elements reside. The required
370 schema_version attribute specifies the version of the MAEC
371 Schema that the document has been written in and that should be
372 used for validation."""
373 subclass = None
374 superclass = None
375 - def __init__(self, id=None, schema_version=None, Analyses=None, Behaviors=None, Actions=None, Pools=None):
376 self.id = _cast(None, id)
377 self.schema_version = _cast(float, schema_version)
378 self.Analyses = Analyses
379 self.Behaviors = Behaviors
380 self.Actions = Actions
381 self.Pools = Pools
387 factory = staticmethod(factory)
393 - def set_Actions(self, Actions): self.Actions = Actions
395 - def set_Pools(self, Pools): self.Pools = Pools
400 - def export(self, outfile, level, namespace_='maec:', name_='BundleType', namespacedef_=''):
401 showIndent(outfile, level)
402 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
403 already_processed = []
404 self.exportAttributes(outfile, level, already_processed, namespace_, name_='BundleType')
405 if self.hasContent_():
406 outfile.write('>\n')
407 self.exportChildren(outfile, level + 1, namespace_, name_)
408 showIndent(outfile, level)
409 outfile.write('</%s%s>\n' % (namespace_, name_))
410 else:
411 outfile.write('/>\n')
412 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='BundleType'):
413 if self.id is not None and 'id' not in already_processed:
414 already_processed.append('id')
415 outfile.write(' id=%s' % (quote_attrib(self.id), ))
416 if self.schema_version is not None and 'schema_version' not in already_processed:
417 already_processed.append('schema_version')
418 outfile.write(' schema_version="%s"' % self.gds_format_float(self.schema_version, input_name='schema_version'))
419 - def exportChildren(self, outfile, level, namespace_='maec:', name_='BundleType', fromsubclass_=False):
420 if self.Analyses is not None:
421 self.Analyses.export(outfile, level, namespace_, name_='Analyses')
422 if self.Behaviors is not None:
423 self.Behaviors.export(outfile, level, namespace_, name_='Behaviors')
424 if self.Actions is not None:
425 self.Actions.export(outfile, level, namespace_, name_='Actions')
426 if self.Pools is not None:
427 self.Pools.export(outfile, level, namespace_, name_='Pools')
428 - def hasContent_(self):
429 if (
430 self.Analyses is not None or
431 self.Behaviors is not None or
432 self.Actions is not None or
433 self.Pools is not None
434 ):
435 return True
436 else:
437 return False
444 if self.id is not None and 'id' not in already_processed:
445 already_processed.append('id')
446 showIndent(outfile, level)
447 outfile.write('id = %s,\n' % (self.id,))
448 if self.schema_version is not None and 'schema_version' not in already_processed:
449 already_processed.append('schema_version')
450 showIndent(outfile, level)
451 outfile.write('schema_version = %f,\n' % (self.schema_version,))
453 if self.Analyses is not None:
454 showIndent(outfile, level)
455 outfile.write('Analyses=model_.AnalysesType(\n')
456 self.Analyses.exportLiteral(outfile, level, name_='Analyses')
457 showIndent(outfile, level)
458 outfile.write('),\n')
459 if self.Behaviors is not None:
460 showIndent(outfile, level)
461 outfile.write('Behaviors=model_.BehaviorsType(\n')
462 self.Behaviors.exportLiteral(outfile, level, name_='Behaviors')
463 showIndent(outfile, level)
464 outfile.write('),\n')
465 if self.Actions is not None:
466 showIndent(outfile, level)
467 outfile.write('Actions=model_.ActionsType(\n')
468 self.Actions.exportLiteral(outfile, level, name_='Actions')
469 showIndent(outfile, level)
470 outfile.write('),\n')
471 if self.Pools is not None:
472 showIndent(outfile, level)
473 outfile.write('Pools=model_.PoolsType(\n')
474 self.Pools.exportLiteral(outfile, level, name_='Pools')
475 showIndent(outfile, level)
476 outfile.write('),\n')
483 value = find_attr_value_('id', node)
484 if value is not None and 'id' not in already_processed:
485 already_processed.append('id')
486 self.id = value
487 value = find_attr_value_('schema_version', node)
488 if value is not None and 'schema_version' not in already_processed:
489 already_processed.append('schema_version')
490 try:
491 self.schema_version = float(value)
492 except ValueError as e:
493 raise ValueError('Bad float/double attribute (schema_version): %s' % e)
494 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
511
512
513
515 """BehaviorCollectionType is intended to provide a mechanism for
516 characterizing collections of behaviors.The name attribute
517 contains the name of the behavior collection, if applicable."""
518 subclass = None
519 superclass = None
520 - def __init__(self, id=None, name=None, Affinity_Type=None, Affinity_Degree=None, Purpose=None, Description=None, Effects=None, Behavior_Sub_Collection=None, Behavior=None, Behavior_Reference=None):
521 self.id = _cast(None, id)
522 self.name = _cast(None, name)
523 self.Affinity_Type = Affinity_Type
524 self.Affinity_Degree = Affinity_Degree
525 self.Purpose = Purpose
526 self.Description = Description
527 self.Effects = Effects
528 if Behavior_Sub_Collection is None:
529 self.Behavior_Sub_Collection = []
530 else:
531 self.Behavior_Sub_Collection = Behavior_Sub_Collection
532 if Behavior is None:
533 self.Behavior = []
534 else:
535 self.Behavior = Behavior
536 if Behavior_Reference is None:
537 self.Behavior_Reference = []
538 else:
539 self.Behavior_Reference = Behavior_Reference
545 factory = staticmethod(factory)
551 - def set_Purpose(self, Purpose): self.Purpose = Purpose
555 - def set_Effects(self, Effects): self.Effects = Effects
572 - def export(self, outfile, level, namespace_='maec:', name_='BehaviorCollectionType', namespacedef_=''):
573 showIndent(outfile, level)
574 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
575 already_processed = []
576 self.exportAttributes(outfile, level, already_processed, namespace_, name_='BehaviorCollectionType')
577 if self.hasContent_():
578 outfile.write('>\n')
579 self.exportChildren(outfile, level + 1, namespace_, name_)
580 showIndent(outfile, level)
581 outfile.write('</%s%s>\n' % (namespace_, name_))
582 else:
583 outfile.write('/>\n')
584 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='BehaviorCollectionType'):
585 if self.id is not None and 'id' not in already_processed:
586 already_processed.append('id')
587 outfile.write(' id=%s' % (quote_attrib(self.id), ))
588 if self.name is not None and 'name' not in already_processed:
589 already_processed.append('name')
590 outfile.write(' name=%s' % (self.gds_format_string(quote_attrib(self.name).encode(ExternalEncoding), input_name='name'), ))
591 - def exportChildren(self, outfile, level, namespace_='maec:', name_='BehaviorCollectionType', fromsubclass_=False):
592 if self.Affinity_Type is not None:
593 showIndent(outfile, level)
594 outfile.write('<%sAffinity_Type>%s</%sAffinity_Type>\n' % (namespace_, self.gds_format_string(quote_xml(self.Affinity_Type).encode(ExternalEncoding), input_name='Affinity_Type'), namespace_))
595 if self.Affinity_Degree is not None:
596 showIndent(outfile, level)
597 outfile.write('<%sAffinity_Degree>%s</%sAffinity_Degree>\n' % (namespace_, self.gds_format_string(quote_xml(self.Affinity_Degree).encode(ExternalEncoding), input_name='Affinity_Degree'), namespace_))
598 if self.Purpose is not None:
599 showIndent(outfile, level)
600 outfile.write('<%sPurpose>%s</%sPurpose>\n' % (namespace_, self.gds_format_string(quote_xml(self.Purpose).encode(ExternalEncoding), input_name='Purpose'), namespace_))
601 if self.Description is not None:
602 self.Description.export(outfile, level, namespace_, name_='Description')
603 if self.Effects is not None:
604 self.Effects.export(outfile, level, namespace_, name_='Effects')
605 for Behavior_Sub_Collection_ in self.Behavior_Sub_Collection:
606 Behavior_Sub_Collection_.export(outfile, level, namespace_, name_='Behavior_Sub_Collection')
607 for Behavior_ in self.Behavior:
608 Behavior_.export(outfile, level, namespace_, name_='Behavior')
609 for Behavior_Reference_ in self.Behavior_Reference:
610 Behavior_Reference_.export(outfile, level, namespace_, name_='Behavior_Reference')
611 - def hasContent_(self):
612 if (
613 self.Affinity_Type is not None or
614 self.Affinity_Degree is not None or
615 self.Purpose is not None or
616 self.Description is not None or
617 self.Effects is not None or
618 self.Behavior_Sub_Collection or
619 self.Behavior or
620 self.Behavior_Reference
621 ):
622 return True
623 else:
624 return False
625 - def exportLiteral(self, outfile, level, name_='BehaviorCollectionType'):
631 if self.id is not None and 'id' not in already_processed:
632 already_processed.append('id')
633 showIndent(outfile, level)
634 outfile.write('id = %s,\n' % (self.id,))
635 if self.name is not None and 'name' not in already_processed:
636 already_processed.append('name')
637 showIndent(outfile, level)
638 outfile.write('name = "%s",\n' % (self.name,))
640 if self.Affinity_Type is not None:
641 showIndent(outfile, level)
642 outfile.write('Affinity_Type=%s,\n' % quote_python(self.Affinity_Type).encode(ExternalEncoding))
643 if self.Affinity_Degree is not None:
644 showIndent(outfile, level)
645 outfile.write('Affinity_Degree=%s,\n' % quote_python(self.Affinity_Degree).encode(ExternalEncoding))
646 if self.Purpose is not None:
647 showIndent(outfile, level)
648 outfile.write('Purpose=%s,\n' % quote_python(self.Purpose).encode(ExternalEncoding))
649 if self.Description is not None:
650 showIndent(outfile, level)
651 outfile.write('Description=model_.StructuredTextType(\n')
652 self.Description.exportLiteral(outfile, level, name_='Description')
653 showIndent(outfile, level)
654 outfile.write('),\n')
655 if self.Effects is not None:
656 showIndent(outfile, level)
657 outfile.write('Effects=model_.EffectsType(\n')
658 self.Effects.exportLiteral(outfile, level, name_='Effects')
659 showIndent(outfile, level)
660 outfile.write('),\n')
661 showIndent(outfile, level)
662 outfile.write('Behavior_Sub_Collection=[\n')
663 level += 1
664 for Behavior_Sub_Collection_ in self.Behavior_Sub_Collection:
665 showIndent(outfile, level)
666 outfile.write('model_.BehaviorCollectionType(\n')
667 Behavior_Sub_Collection_.exportLiteral(outfile, level, name_='BehaviorCollectionType')
668 showIndent(outfile, level)
669 outfile.write('),\n')
670 level -= 1
671 showIndent(outfile, level)
672 outfile.write('],\n')
673 showIndent(outfile, level)
674 outfile.write('Behavior=[\n')
675 level += 1
676 for Behavior_ in self.Behavior:
677 showIndent(outfile, level)
678 outfile.write('model_.BehaviorType(\n')
679 Behavior_.exportLiteral(outfile, level, name_='BehaviorType')
680 showIndent(outfile, level)
681 outfile.write('),\n')
682 level -= 1
683 showIndent(outfile, level)
684 outfile.write('],\n')
685 showIndent(outfile, level)
686 outfile.write('Behavior_Reference=[\n')
687 level += 1
688 for Behavior_Reference_ in self.Behavior_Reference:
689 showIndent(outfile, level)
690 outfile.write('model_.BehaviorReferenceType(\n')
691 Behavior_Reference_.exportLiteral(outfile, level, name_='BehaviorReferenceType')
692 showIndent(outfile, level)
693 outfile.write('),\n')
694 level -= 1
695 showIndent(outfile, level)
696 outfile.write('],\n')
703 value = find_attr_value_('id', node)
704 if value is not None and 'id' not in already_processed:
705 already_processed.append('id')
706 self.id = value
707 value = find_attr_value_('name', node)
708 if value is not None and 'name' not in already_processed:
709 already_processed.append('name')
710 self.name = value
711 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
712 if nodeName_ == 'Affinity_Type':
713 Affinity_Type_ = child_.text
714 Affinity_Type_ = self.gds_validate_string(Affinity_Type_, node, 'Affinity_Type')
715 self.Affinity_Type = Affinity_Type_
716 elif nodeName_ == 'Affinity_Degree':
717 Affinity_Degree_ = child_.text
718 Affinity_Degree_ = self.gds_validate_string(Affinity_Degree_, node, 'Affinity_Degree')
719 self.Affinity_Degree = Affinity_Degree_
720 elif nodeName_ == 'Purpose':
721 Purpose_ = child_.text
722 Purpose_ = self.gds_validate_string(Purpose_, node, 'Purpose')
723 self.Purpose = Purpose_
724 elif nodeName_ == 'Description':
725 obj_ = StructuredTextType.factory()
726 obj_.build(child_)
727 self.set_Description(obj_)
728 elif nodeName_ == 'Effects':
729 obj_ = EffectsType.factory()
730 obj_.build(child_)
731 self.set_Effects(obj_)
732 elif nodeName_ == 'Behavior_Sub_Collection':
733 obj_ = BehaviorCollectionType.factory()
734 obj_.build(child_)
735 self.Behavior_Sub_Collection.append(obj_)
736 elif nodeName_ == 'Behavior':
737 obj_ = BehaviorType.factory()
738 obj_.build(child_)
739 self.Behavior.append(obj_)
740 elif nodeName_ == 'Behavior_Reference':
741 obj_ = BehaviorReferenceType.factory()
742 obj_.build(child_)
743 self.Behavior_Reference.append(obj_)
744
745
746
748 """BehaviorType is intended to serve as a method for the
749 characterization of malicious behaviors found or observed in
750 malware. Behaviors can be thought of as representing the purpose
751 behind groups of MAEC actions, and are therefore representative
752 of distinct portions of higher-level malware functionality.
753 Thus, while a malware instance may perform some thousands of
754 actions, it is likely that these actions represent only a few
755 dozen distinct behaviors. Some examples include vulnerability
756 exploitation, email address harvesting, and the disabling of a
757 security service.The ordinal_position attribute is intended to
758 reference the ordinal position of the behavior with respect to
759 the execution of the malware.The successful attribute is used to
760 describe whether the behavior was successful or not.The duration
761 attribute represents the duration of the behavior. Such a value
762 may be derived by calculating the difference between the
763 timestamps of the first and last actions that compose the
764 behavior."""
765 subclass = None
766 superclass = None
767 - def __init__(self, successful=None, duration=None, ordinal_position=None, id=None, Purpose=None, Description=None, Discovery_Method=None, Actions=None, Objects=None, Effects=None, Related_Behaviors=None):
768 self.successful = _cast(bool, successful)
769 self.duration = _cast(None, duration)
770 self.ordinal_position = _cast(int, ordinal_position)
771 self.id = _cast(None, id)
772 self.Purpose = Purpose
773 self.Description = Description
774 self.Discovery_Method = Discovery_Method
775 self.Actions = Actions
776 self.Objects = Objects
777 self.Effects = Effects
778 self.Related_Behaviors = Related_Behaviors
784 factory = staticmethod(factory)
786 - def set_Purpose(self, Purpose): self.Purpose = Purpose
792 - def set_Actions(self, Actions): self.Actions = Actions
794 - def set_Objects(self, Objects): self.Objects = Objects
796 - def set_Effects(self, Effects): self.Effects = Effects
807 - def export(self, outfile, level, namespace_='maec:', name_='BehaviorType', namespacedef_=''):
808 showIndent(outfile, level)
809 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
810 already_processed = []
811 self.exportAttributes(outfile, level, already_processed, namespace_, name_='BehaviorType')
812 if self.hasContent_():
813 outfile.write('>\n')
814 self.exportChildren(outfile, level + 1, namespace_, name_)
815 showIndent(outfile, level)
816 outfile.write('</%s%s>\n' % (namespace_, name_))
817 else:
818 outfile.write('/>\n')
819 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='BehaviorType'):
820 if self.successful is not None and 'successful' not in already_processed:
821 already_processed.append('successful')
822 outfile.write(' successful="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.successful)), input_name='successful'))
823 if self.duration is not None and 'duration' not in already_processed:
824 already_processed.append('duration')
825 outfile.write(' duration=%s' % (self.gds_format_string(quote_attrib(self.duration).encode(ExternalEncoding), input_name='duration'), ))
826 if self.ordinal_position is not None and 'ordinal_position' not in already_processed:
827 already_processed.append('ordinal_position')
828 outfile.write(' ordinal_position="%s"' % self.gds_format_integer(self.ordinal_position, input_name='ordinal_position'))
829 if self.id is not None and 'id' not in already_processed:
830 already_processed.append('id')
831 outfile.write(' id=%s' % (quote_attrib(self.id), ))
832 - def exportChildren(self, outfile, level, namespace_='maec:', name_='BehaviorType', fromsubclass_=False):
833 if self.Purpose is not None:
834 self.Purpose.export(outfile, level, namespace_, name_='Purpose')
835 if self.Description is not None:
836 self.Description.export(outfile, level, namespace_, name_='Description')
837 if self.Discovery_Method is not None:
838 self.Discovery_Method.export(outfile, level, namespace_, name_='Discovery_Method')
839 if self.Actions is not None:
840 self.Actions.export(outfile, level, namespace_, name_='Actions')
841 if self.Objects is not None:
842 self.Objects.export(outfile, level, namespace_, name_='Objects')
843 if self.Effects is not None:
844 self.Effects.export(outfile, level, namespace_, name_='Effects')
845 if self.Related_Behaviors is not None:
846 self.Related_Behaviors.export(outfile, level, namespace_, name_='Related_Behaviors')
847 - def hasContent_(self):
848 if (
849 self.Purpose is not None or
850 self.Description is not None or
851 self.Discovery_Method is not None or
852 self.Actions is not None or
853 self.Objects is not None or
854 self.Effects is not None or
855 self.Related_Behaviors is not None
856 ):
857 return True
858 else:
859 return False
866 if self.successful is not None and 'successful' not in already_processed:
867 already_processed.append('successful')
868 showIndent(outfile, level)
869 outfile.write('successful = %s,\n' % (self.successful,))
870 if self.duration is not None and 'duration' not in already_processed:
871 already_processed.append('duration')
872 showIndent(outfile, level)
873 outfile.write('duration = "%s",\n' % (self.duration,))
874 if self.ordinal_position is not None and 'ordinal_position' not in already_processed:
875 already_processed.append('ordinal_position')
876 showIndent(outfile, level)
877 outfile.write('ordinal_position = %d,\n' % (self.ordinal_position,))
878 if self.id is not None and 'id' not in already_processed:
879 already_processed.append('id')
880 showIndent(outfile, level)
881 outfile.write('id = %s,\n' % (self.id,))
883 if self.Purpose is not None:
884 showIndent(outfile, level)
885 outfile.write('Purpose=model_.PurposeType(\n')
886 self.Purpose.exportLiteral(outfile, level, name_='Purpose')
887 showIndent(outfile, level)
888 outfile.write('),\n')
889 if self.Description is not None:
890 showIndent(outfile, level)
891 outfile.write('Description=model_.StructuredTextType(\n')
892 self.Description.exportLiteral(outfile, level, name_='Description')
893 showIndent(outfile, level)
894 outfile.write('),\n')
895 if self.Discovery_Method is not None:
896 showIndent(outfile, level)
897 outfile.write('Discovery_Method=model_.DiscoveryMethod(\n')
898 self.Discovery_Method.exportLiteral(outfile, level, name_='Discovery_Method')
899 showIndent(outfile, level)
900 outfile.write('),\n')
901 if self.Actions is not None:
902 showIndent(outfile, level)
903 outfile.write('Actions=model_.ActionsType1(\n')
904 self.Actions.exportLiteral(outfile, level, name_='Actions')
905 showIndent(outfile, level)
906 outfile.write('),\n')
907 if self.Objects is not None:
908 showIndent(outfile, level)
909 outfile.write('Objects=model_.ObjectsType(\n')
910 self.Objects.exportLiteral(outfile, level, name_='Objects')
911 showIndent(outfile, level)
912 outfile.write('),\n')
913 if self.Effects is not None:
914 showIndent(outfile, level)
915 outfile.write('Effects=model_.EffectsType1(\n')
916 self.Effects.exportLiteral(outfile, level, name_='Effects')
917 showIndent(outfile, level)
918 outfile.write('),\n')
919 if self.Related_Behaviors is not None:
920 showIndent(outfile, level)
921 outfile.write('Related_Behaviors=model_.Related_BehaviorsType(\n')
922 self.Related_Behaviors.exportLiteral(outfile, level, name_='Related_Behaviors')
923 showIndent(outfile, level)
924 outfile.write('),\n')
931 value = find_attr_value_('successful', node)
932 if value is not None and 'successful' not in already_processed:
933 already_processed.append('successful')
934 if value in ('true', '1'):
935 self.successful = True
936 elif value in ('false', '0'):
937 self.successful = False
938 else:
939 raise_parse_error(node, 'Bad boolean attribute')
940 value = find_attr_value_('duration', node)
941 if value is not None and 'duration' not in already_processed:
942 already_processed.append('duration')
943 self.duration = value
944 value = find_attr_value_('ordinal_position', node)
945 if value is not None and 'ordinal_position' not in already_processed:
946 already_processed.append('ordinal_position')
947 try:
948 self.ordinal_position = int(value)
949 except ValueError as e:
950 raise_parse_error(node, 'Bad integer attribute: %s' % e)
951 if self.ordinal_position <= 0:
952 raise_parse_error(node, 'Invalid PositiveInteger')
953 value = find_attr_value_('id', node)
954 if value is not None and 'id' not in already_processed:
955 already_processed.append('id')
956 self.id = value
957 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
986
987
988
990 """BehaviorReferenceType is intended to serve as a method for linking
991 to behaviors.The behavior_id attribute refers to the ID of the
992 behavior being referenced.The type attribute refers to the type
993 of behavior entity that is being referenced. Possible values:
994 Behavior, Behavior_Collection."""
995 subclass = None
996 superclass = None
997 - def __init__(self, type_=None, behavior_id=None):
998 self.type_ = _cast(None, type_)
999 self.behavior_id = _cast(None, behavior_id)
1000 pass
1006 factory = staticmethod(factory)
1008 - def set_type(self, type_): self.type_ = type_
1011 - def export(self, outfile, level, namespace_='maec:', name_='BehaviorReferenceType', namespacedef_=''):
1012 showIndent(outfile, level)
1013 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
1014 already_processed = []
1015 self.exportAttributes(outfile, level, already_processed, namespace_, name_='BehaviorReferenceType')
1016 if self.hasContent_():
1017 outfile.write('>\n')
1018 self.exportChildren(outfile, level + 1, namespace_, name_)
1019 outfile.write('</%s%s>\n' % (namespace_, name_))
1020 else:
1021 outfile.write('/>\n')
1022 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='BehaviorReferenceType'):
1023 if self.type_ is not None and 'type_' not in already_processed:
1024 already_processed.append('type_')
1025 outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))
1026 if self.behavior_id is not None and 'behavior_id' not in already_processed:
1027 already_processed.append('behavior_id')
1028 outfile.write(' behavior_id=%s' % (quote_attrib(self.behavior_id), ))
1029 - def exportChildren(self, outfile, level, namespace_='maec:', name_='BehaviorReferenceType', fromsubclass_=False):
1031 - def hasContent_(self):
1032 if (
1033
1034 ):
1035 return True
1036 else:
1037 return False
1038 - def exportLiteral(self, outfile, level, name_='BehaviorReferenceType'):
1044 if self.type_ is not None and 'type_' not in already_processed:
1045 already_processed.append('type_')
1046 showIndent(outfile, level)
1047 outfile.write('type_ = "%s",\n' % (self.type_,))
1048 if self.behavior_id is not None and 'behavior_id' not in already_processed:
1049 already_processed.append('behavior_id')
1050 showIndent(outfile, level)
1051 outfile.write('behavior_id = %s,\n' % (self.behavior_id,))
1060 value = find_attr_value_('type', node)
1061 if value is not None and 'type' not in already_processed:
1062 already_processed.append('type')
1063 self.type_ = value
1064 value = find_attr_value_('behavior_id', node)
1065 if value is not None and 'behavior_id' not in already_processed:
1066 already_processed.append('behavior_id')
1067 self.behavior_id = value
1068 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
1070
1071
1072
1074 """ActionCollectionType is intended to provide a method for
1075 characterizing collections of actions. This can be useful for
1076 organizing actions that may be related and where the exact
1077 relationship is unknown, as well as actions whose associated
1078 behavior has not yet been established.The name attribute
1079 contains the name of the action collection, if applicable."""
1080 subclass = None
1081 superclass = None
1082 - def __init__(self, id=None, name=None, Affinity_Type=None, Affinity_Degree=None, Description=None, Action_Sub_Collection=None, Action=None, Action_Reference=None, Effects=None):
1083 self.id = _cast(None, id)
1084 self.name = _cast(None, name)
1085 self.Affinity_Type = Affinity_Type
1086 self.Affinity_Degree = Affinity_Degree
1087 self.Description = Description
1088 if Action_Sub_Collection is None:
1089 self.Action_Sub_Collection = []
1090 else:
1091 self.Action_Sub_Collection = Action_Sub_Collection
1092 if Action is None:
1093 self.Action = []
1094 else:
1095 self.Action = Action
1096 if Action_Reference is None:
1097 self.Action_Reference = []
1098 else:
1099 self.Action_Reference = Action_Reference
1100 self.Effects = Effects
1106 factory = staticmethod(factory)
1118 - def set_Action(self, Action): self.Action = Action
1119 - def add_Action(self, value): self.Action.append(value)
1120 - def insert_Action(self, index, value): self.Action[index] = value
1126 - def set_Effects(self, Effects): self.Effects = Effects
1131 - def export(self, outfile, level, namespace_='maec:', name_='ActionCollectionType', namespacedef_=''):
1132 showIndent(outfile, level)
1133 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
1134 already_processed = []
1135 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ActionCollectionType')
1136 if self.hasContent_():
1137 outfile.write('>\n')
1138 self.exportChildren(outfile, level + 1, namespace_, name_)
1139 showIndent(outfile, level)
1140 outfile.write('</%s%s>\n' % (namespace_, name_))
1141 else:
1142 outfile.write('/>\n')
1143 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ActionCollectionType'):
1144 if self.id is not None and 'id' not in already_processed:
1145 already_processed.append('id')
1146 outfile.write(' id=%s' % (quote_attrib(self.id), ))
1147 if self.name is not None and 'name' not in already_processed:
1148 already_processed.append('name')
1149 outfile.write(' name=%s' % (self.gds_format_string(quote_attrib(self.name).encode(ExternalEncoding), input_name='name'), ))
1150 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ActionCollectionType', fromsubclass_=False):
1151 if self.Affinity_Type is not None:
1152 showIndent(outfile, level)
1153 outfile.write('<%sAffinity_Type>%s</%sAffinity_Type>\n' % (namespace_, self.gds_format_string(quote_xml(self.Affinity_Type).encode(ExternalEncoding), input_name='Affinity_Type'), namespace_))
1154 if self.Affinity_Degree is not None:
1155 showIndent(outfile, level)
1156 outfile.write('<%sAffinity_Degree>%s</%sAffinity_Degree>\n' % (namespace_, self.gds_format_string(quote_xml(self.Affinity_Degree).encode(ExternalEncoding), input_name='Affinity_Degree'), namespace_))
1157 if self.Description is not None:
1158 self.Description.export(outfile, level, namespace_, name_='Description')
1159 for Action_Sub_Collection_ in self.Action_Sub_Collection:
1160 Action_Sub_Collection_.export(outfile, level, namespace_, name_='Action_Sub-Collection')
1161 for Action_ in self.Action:
1162 Action_.export(outfile, level, namespace_, name_='Action')
1163 for Action_Reference_ in self.Action_Reference:
1164 Action_Reference_.export(outfile, level, namespace_, name_='Action_Reference')
1165 if self.Effects is not None:
1166 self.Effects.export(outfile, level, namespace_, name_='Effects')
1167 - def hasContent_(self):
1168 if (
1169 self.Affinity_Type is not None or
1170 self.Affinity_Degree is not None or
1171 self.Description is not None or
1172 self.Action_Sub_Collection or
1173 self.Action or
1174 self.Action_Reference or
1175 self.Effects is not None
1176 ):
1177 return True
1178 else:
1179 return False
1180 - def exportLiteral(self, outfile, level, name_='ActionCollectionType'):
1186 if self.id is not None and 'id' not in already_processed:
1187 already_processed.append('id')
1188 showIndent(outfile, level)
1189 outfile.write('id = %s,\n' % (self.id,))
1190 if self.name is not None and 'name' not in already_processed:
1191 already_processed.append('name')
1192 showIndent(outfile, level)
1193 outfile.write('name = "%s",\n' % (self.name,))
1195 if self.Affinity_Type is not None:
1196 showIndent(outfile, level)
1197 outfile.write('Affinity_Type=%s,\n' % quote_python(self.Affinity_Type).encode(ExternalEncoding))
1198 if self.Affinity_Degree is not None:
1199 showIndent(outfile, level)
1200 outfile.write('Affinity_Degree=%s,\n' % quote_python(self.Affinity_Degree).encode(ExternalEncoding))
1201 if self.Description is not None:
1202 showIndent(outfile, level)
1203 outfile.write('Description=model_.StructuredTextType(\n')
1204 self.Description.exportLiteral(outfile, level, name_='Description')
1205 showIndent(outfile, level)
1206 outfile.write('),\n')
1207 showIndent(outfile, level)
1208 outfile.write('Action_Sub_Collection=[\n')
1209 level += 1
1210 for Action_Sub_Collection_ in self.Action_Sub_Collection:
1211 showIndent(outfile, level)
1212 outfile.write('model_.ActionCollectionType(\n')
1213 Action_Sub_Collection_.exportLiteral(outfile, level, name_='ActionCollectionType')
1214 showIndent(outfile, level)
1215 outfile.write('),\n')
1216 level -= 1
1217 showIndent(outfile, level)
1218 outfile.write('],\n')
1219 showIndent(outfile, level)
1220 outfile.write('Action=[\n')
1221 level += 1
1222 for Action_ in self.Action:
1223 showIndent(outfile, level)
1224 outfile.write('model_.ActionType(\n')
1225 Action_.exportLiteral(outfile, level, name_='ActionType')
1226 showIndent(outfile, level)
1227 outfile.write('),\n')
1228 level -= 1
1229 showIndent(outfile, level)
1230 outfile.write('],\n')
1231 showIndent(outfile, level)
1232 outfile.write('Action_Reference=[\n')
1233 level += 1
1234 for Action_Reference_ in self.Action_Reference:
1235 showIndent(outfile, level)
1236 outfile.write('model_.ActionReferenceType(\n')
1237 Action_Reference_.exportLiteral(outfile, level, name_='ActionReferenceType')
1238 showIndent(outfile, level)
1239 outfile.write('),\n')
1240 level -= 1
1241 showIndent(outfile, level)
1242 outfile.write('],\n')
1243 if self.Effects is not None:
1244 showIndent(outfile, level)
1245 outfile.write('Effects=model_.EffectsType2(\n')
1246 self.Effects.exportLiteral(outfile, level, name_='Effects')
1247 showIndent(outfile, level)
1248 outfile.write('),\n')
1255 value = find_attr_value_('id', node)
1256 if value is not None and 'id' not in already_processed:
1257 already_processed.append('id')
1258 self.id = value
1259 value = find_attr_value_('name', node)
1260 if value is not None and 'name' not in already_processed:
1261 already_processed.append('name')
1262 self.name = value
1263 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
1264 if nodeName_ == 'Affinity_Type':
1265 Affinity_Type_ = child_.text
1266 Affinity_Type_ = self.gds_validate_string(Affinity_Type_, node, 'Affinity_Type')
1267 self.Affinity_Type = Affinity_Type_
1268 elif nodeName_ == 'Affinity_Degree':
1269 Affinity_Degree_ = child_.text
1270 Affinity_Degree_ = self.gds_validate_string(Affinity_Degree_, node, 'Affinity_Degree')
1271 self.Affinity_Degree = Affinity_Degree_
1272 elif nodeName_ == 'Description':
1273 obj_ = StructuredTextType.factory()
1274 obj_.build(child_)
1275 self.set_Description(obj_)
1276 elif nodeName_ == 'Action_Sub-Collection':
1277 obj_ = ActionCollectionType.factory()
1278 obj_.build(child_)
1279 self.Action_Sub_Collection.append(obj_)
1280 elif nodeName_ == 'Action':
1281 obj_ = ActionType.factory()
1282 obj_.build(child_)
1283 self.Action.append(obj_)
1284 elif nodeName_ == 'Action_Reference':
1285 obj_ = ActionReferenceType.factory()
1286 obj_.build(child_)
1287 self.Action_Reference.append(obj_)
1288 elif nodeName_ == 'Effects':
1289 obj_ = EffectsType2.factory()
1290 obj_.build(child_)
1291 self.set_Effects(obj_)
1292
1293
1294
1296 """ActionType is intended to serve as a method for the characterization
1297 of actions found or observed in malware. Actions can be thought
1298 of as system state changes and similar operations that represent
1299 the fundamental low-level operation of malware. Some examples
1300 include the creation of a file, deletion of a registry key, and
1301 the sending of some arbitrary packets on a socket.The type
1302 attribute is intended to characterize the type of action that
1303 occurred, based on its activity. Possible values: Login/Logon,
1304 Logout/Logoff, Start, Stop, Suspend/Pause, Resume, Create,
1305 Remove/Delete, Access/Open, Close, Move, Copy/Duplicate, Read,
1306 Write, Execute, Quarantine, Find, Clean, Block, Update, Upgrade,
1307 Scan, Filter, Install, Allocate, Initialize, Save, Connect,
1308 Disconnect, Audit, Replicate, Detect, Alert, Backup, Search,
1309 Restore, Get, Set, Assign, Send, Receive, Transmit, Map, Load,
1310 Query, Enumerate, Bind, Free, Kill, Encrypt, Decrypt, Encode,
1311 Decode, Pack, Unpack, Archive, Compress, Decompress, Download,
1312 Upload, Load, Fork, Join,Merge, Interleave, Schedule, Call,
1313 Compare, Wipe/Destroy/Purge, Throw/Raise, Lock, Unlock,
1314 Synchronize, Hook, Unhook, Draw, Click, Press, Depress,
1315 Close(network), Open(network), Callback, Drop, Accept, Deny,
1316 Modify, Listen, Send,Start_Winsock, Other.The action_name
1317 attribute is intended to contain the name of the action
1318 performed. Typically, this is composed of the Action_Type
1319 concatenated with the type of object the action is performed
1320 upon. For instance, the action name for creating a file would be
1321 'create_file', where the action_type is 'create'. If the object
1322 does not exist in MAEC's object_type enumeration, it can still
1323 be included as the second half of the action name. If a specific
1324 object attribute is being used in the action, this attribute can
1325 be concatenated after the object type. For instance, an action
1326 that sets a timestamp on a file would 'set_file_timestamp'.
1327 Object modifiers can be used by including the modifier in front
1328 of the object type. For instance, an action that creates a
1329 remote thread would be 'create_remote_thread'.The
1330 ordinal_position attribute is intended to reference the ordinal
1331 position of the action with respect to the execution of the
1332 malware.The successful attribute is used to describe whether the
1333 action was successful or not.The timestamp attribute represents
1334 the local or relative time at which the action occurred or was
1335 observed."""
1336 subclass = None
1337 superclass = None
1338 - def __init__(self, successful=None, timestamp=None, action_name=None, ordinal_position=None, type_=None, id=None, Description=None, Discovery_Method=None, Action_Initiator=None, Action_Implementation=None, Objects=None, Effects=None, Related_Actions=None):
1339 self.successful = _cast(bool, successful)
1340 self.timestamp = _cast(None, timestamp)
1341 self.action_name = _cast(None, action_name)
1342 self.ordinal_position = _cast(int, ordinal_position)
1343 self.type_ = _cast(None, type_)
1344 self.id = _cast(None, id)
1345 self.Description = Description
1346 self.Discovery_Method = Discovery_Method
1347 self.Action_Initiator = Action_Initiator
1348 self.Action_Implementation = Action_Implementation
1349 self.Objects = Objects
1350 self.Effects = Effects
1351 self.Related_Actions = Related_Actions
1357 factory = staticmethod(factory)
1367 - def set_Objects(self, Objects): self.Objects = Objects
1369 - def set_Effects(self, Effects): self.Effects = Effects
1381 - def set_type(self, type_): self.type_ = type_
1384 - def export(self, outfile, level, namespace_='maec:', name_='ActionType', namespacedef_=''):
1385 showIndent(outfile, level)
1386 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
1387 already_processed = []
1388 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ActionType')
1389 if self.hasContent_():
1390 outfile.write('>\n')
1391 self.exportChildren(outfile, level + 1, namespace_, name_)
1392 showIndent(outfile, level)
1393 outfile.write('</%s%s>\n' % (namespace_, name_))
1394 else:
1395 outfile.write('/>\n')
1396 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ActionType'):
1397 if self.successful is not None and 'successful' not in already_processed:
1398 already_processed.append('successful')
1399 outfile.write(' successful="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.successful)), input_name='successful'))
1400 if self.timestamp is not None and 'timestamp' not in already_processed:
1401 already_processed.append('timestamp')
1402 outfile.write(' timestamp=%s' % (quote_attrib(self.timestamp), ))
1403 if self.action_name is not None and 'action_name' not in already_processed:
1404 already_processed.append('action_name')
1405 outfile.write(' action_name=%s' % (self.gds_format_string(quote_attrib(self.action_name).encode(ExternalEncoding), input_name='action_name'), ))
1406 if self.ordinal_position is not None and 'ordinal_position' not in already_processed:
1407 already_processed.append('ordinal_position')
1408 outfile.write(' ordinal_position="%s"' % self.gds_format_integer(self.ordinal_position, input_name='ordinal_position'))
1409 if self.type_ is not None and 'type_' not in already_processed:
1410 already_processed.append('type_')
1411 outfile.write(' type=%s' % (quote_attrib(self.type_), ))
1412 if self.id is not None and 'id' not in already_processed:
1413 already_processed.append('id')
1414 outfile.write(' id=%s' % (quote_attrib(self.id), ))
1415 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ActionType', fromsubclass_=False):
1416 if self.Description is not None:
1417 self.Description.export(outfile, level, namespace_, name_='Description')
1418 if self.Discovery_Method is not None:
1419 self.Discovery_Method.export(outfile, level, namespace_, name_='Discovery_Method')
1420 if self.Action_Initiator is not None:
1421 self.Action_Initiator.export(outfile, level, namespace_, name_='Action_Initiator')
1422 if self.Action_Implementation is not None:
1423 self.Action_Implementation.export(outfile, level, namespace_, name_='Action_Implementation')
1424 if self.Objects is not None:
1425 self.Objects.export(outfile, level, namespace_, name_='Objects')
1426 if self.Effects is not None:
1427 self.Effects.export(outfile, level, namespace_, name_='Effects')
1428 if self.Related_Actions is not None:
1429 self.Related_Actions.export(outfile, level, namespace_, name_='Related_Actions')
1430 - def hasContent_(self):
1431 if (
1432 self.Description is not None or
1433 self.Discovery_Method is not None or
1434 self.Action_Initiator is not None or
1435 self.Action_Implementation is not None or
1436 self.Objects is not None or
1437 self.Effects is not None or
1438 self.Related_Actions is not None
1439 ):
1440 return True
1441 else:
1442 return False
1449 if self.successful is not None and 'successful' not in already_processed:
1450 already_processed.append('successful')
1451 showIndent(outfile, level)
1452 outfile.write('successful = %s,\n' % (self.successful,))
1453 if self.timestamp is not None and 'timestamp' not in already_processed:
1454 already_processed.append('timestamp')
1455 showIndent(outfile, level)
1456 outfile.write('timestamp = %s,\n' % (self.timestamp,))
1457 if self.action_name is not None and 'action_name' not in already_processed:
1458 already_processed.append('action_name')
1459 showIndent(outfile, level)
1460 outfile.write('action_name = "%s",\n' % (self.action_name,))
1461 if self.ordinal_position is not None and 'ordinal_position' not in already_processed:
1462 already_processed.append('ordinal_position')
1463 showIndent(outfile, level)
1464 outfile.write('ordinal_position = %d,\n' % (self.ordinal_position,))
1465 if self.type_ is not None and 'type_' not in already_processed:
1466 already_processed.append('type_')
1467 showIndent(outfile, level)
1468 outfile.write('type_ = %s,\n' % (self.type_,))
1469 if self.id is not None and 'id' not in already_processed:
1470 already_processed.append('id')
1471 showIndent(outfile, level)
1472 outfile.write('id = %s,\n' % (self.id,))
1474 if self.Description is not None:
1475 showIndent(outfile, level)
1476 outfile.write('Description=model_.StructuredTextType(\n')
1477 self.Description.exportLiteral(outfile, level, name_='Description')
1478 showIndent(outfile, level)
1479 outfile.write('),\n')
1480 if self.Discovery_Method is not None:
1481 showIndent(outfile, level)
1482 outfile.write('Discovery_Method=model_.DiscoveryMethod(\n')
1483 self.Discovery_Method.exportLiteral(outfile, level, name_='Discovery_Method')
1484 showIndent(outfile, level)
1485 outfile.write('),\n')
1486 if self.Action_Initiator is not None:
1487 showIndent(outfile, level)
1488 outfile.write('Action_Initiator=model_.Action_InitiatorType(\n')
1489 self.Action_Initiator.exportLiteral(outfile, level, name_='Action_Initiator')
1490 showIndent(outfile, level)
1491 outfile.write('),\n')
1492 if self.Action_Implementation is not None:
1493 showIndent(outfile, level)
1494 outfile.write('Action_Implementation=model_.ActionImplementationType(\n')
1495 self.Action_Implementation.exportLiteral(outfile, level, name_='Action_Implementation')
1496 showIndent(outfile, level)
1497 outfile.write('),\n')
1498 if self.Objects is not None:
1499 showIndent(outfile, level)
1500 outfile.write('Objects=model_.ObjectsType1(\n')
1501 self.Objects.exportLiteral(outfile, level, name_='Objects')
1502 showIndent(outfile, level)
1503 outfile.write('),\n')
1504 if self.Effects is not None:
1505 showIndent(outfile, level)
1506 outfile.write('Effects=model_.EffectsType3(\n')
1507 self.Effects.exportLiteral(outfile, level, name_='Effects')
1508 showIndent(outfile, level)
1509 outfile.write('),\n')
1510 if self.Related_Actions is not None:
1511 showIndent(outfile, level)
1512 outfile.write('Related_Actions=model_.Related_ActionsType(\n')
1513 self.Related_Actions.exportLiteral(outfile, level, name_='Related_Actions')
1514 showIndent(outfile, level)
1515 outfile.write('),\n')
1522 value = find_attr_value_('successful', node)
1523 if value is not None and 'successful' not in already_processed:
1524 already_processed.append('successful')
1525 if value in ('true', '1'):
1526 self.successful = True
1527 elif value in ('false', '0'):
1528 self.successful = False
1529 else:
1530 raise_parse_error(node, 'Bad boolean attribute')
1531 value = find_attr_value_('timestamp', node)
1532 if value is not None and 'timestamp' not in already_processed:
1533 already_processed.append('timestamp')
1534 self.timestamp = value
1535 value = find_attr_value_('action_name', node)
1536 if value is not None and 'action_name' not in already_processed:
1537 already_processed.append('action_name')
1538 self.action_name = value
1539 value = find_attr_value_('ordinal_position', node)
1540 if value is not None and 'ordinal_position' not in already_processed:
1541 already_processed.append('ordinal_position')
1542 try:
1543 self.ordinal_position = int(value)
1544 except ValueError as e:
1545 raise_parse_error(node, 'Bad integer attribute: %s' % e)
1546 if self.ordinal_position <= 0:
1547 raise_parse_error(node, 'Invalid PositiveInteger')
1548 value = find_attr_value_('type', node)
1549 if value is not None and 'type' not in already_processed:
1550 already_processed.append('type')
1551 self.type_ = value
1552 value = find_attr_value_('id', node)
1553 if value is not None and 'id' not in already_processed:
1554 already_processed.append('id')
1555 self.id = value
1556 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
1585
1586
1587
1589 """ActionReferenceType is intended to serve as a method for linking to
1590 actions.The action_id attribute refers to the ID of the action
1591 being referenced.The type field refers to the type of action
1592 entity that is being referenced. Possible values: Action,
1593 Action_Collection."""
1594 subclass = None
1595 superclass = None
1596 - def __init__(self, type_=None, action_id=None):
1597 self.type_ = _cast(None, type_)
1598 self.action_id = _cast(None, action_id)
1599 pass
1605 factory = staticmethod(factory)
1607 - def set_type(self, type_): self.type_ = type_
1610 - def export(self, outfile, level, namespace_='maec:', name_='ActionReferenceType', namespacedef_=''):
1611 showIndent(outfile, level)
1612 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
1613 already_processed = []
1614 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ActionReferenceType')
1615 if self.hasContent_():
1616 outfile.write('>\n')
1617 self.exportChildren(outfile, level + 1, namespace_, name_)
1618 outfile.write('</%s%s>\n' % (namespace_, name_))
1619 else:
1620 outfile.write('/>\n')
1621 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ActionReferenceType'):
1622 if self.type_ is not None and 'type_' not in already_processed:
1623 already_processed.append('type_')
1624 outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))
1625 if self.action_id is not None and 'action_id' not in already_processed:
1626 already_processed.append('action_id')
1627 outfile.write(' action_id=%s' % (quote_attrib(self.action_id), ))
1628 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ActionReferenceType', fromsubclass_=False):
1630 - def hasContent_(self):
1631 if (
1632
1633 ):
1634 return True
1635 else:
1636 return False
1637 - def exportLiteral(self, outfile, level, name_='ActionReferenceType'):
1643 if self.type_ is not None and 'type_' not in already_processed:
1644 already_processed.append('type_')
1645 showIndent(outfile, level)
1646 outfile.write('type_ = "%s",\n' % (self.type_,))
1647 if self.action_id is not None and 'action_id' not in already_processed:
1648 already_processed.append('action_id')
1649 showIndent(outfile, level)
1650 outfile.write('action_id = %s,\n' % (self.action_id,))
1659 value = find_attr_value_('type', node)
1660 if value is not None and 'type' not in already_processed:
1661 already_processed.append('type')
1662 self.type_ = value
1663 value = find_attr_value_('action_id', node)
1664 if value is not None and 'action_id' not in already_processed:
1665 already_processed.append('action_id')
1666 self.action_id = value
1667 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
1669
1670
1671
1673 """ObjectType is intended to serve as a method for the characterization
1674 of any entities that actions and behaviors operate on or are
1675 associated with.The object_name attribute specifies the name of
1676 the object, if applicable.The type attribute is intended to
1677 characterize the type of object being characterized in this
1678 element. Possible values are: URI, Host, Session, Session Token,
1679 Account, Device (physical), Handle, Heap,Memory Address, Memory
1680 Page, Window, Dialog, Parameter, Authentication Token,Encryption
1681 Token, Web Query, Protocol Header, Protocol Field, Link, SQL
1682 Query,Database, ACL, Role, System, VM, Signature, Channel, API
1683 Call, Environment Variable, Application, Network, Configuration,
1684 Policy, Tack, Malware, Message,Email Message, Media, Operating
1685 System, Query, Domain, Event, OtherThe permanent attribute is
1686 intended to characterize whether an object stays resident after
1687 execution of the malware, that is, whather or not it remains on
1688 the filesystem or other non-volatile entity in some fashion."""
1689 subclass = None
1690 superclass = None
1691 - def __init__(self, object_name=None, permanent=None, type_=None, id=None, Object_Size=None, Classifications=None, Associated_Code=None, Related_Objects=None, File_System_Object_Attributes=None, GUI_Object_Attributes=None, IPC_Object_Attributes=None, Internet_Object_Attributes=None, Module_Object_Attributes=None, Registry_Object_Attributes=None, Process_Object_Attributes=None, Memory_Object_Attributes=None, Network_Object_Attributes=None, Daemon_Object_Attributes=None, Custom_Object_Attributes=None):
1692 self.object_name = _cast(None, object_name)
1693 self.permanent = _cast(bool, permanent)
1694 self.type_ = _cast(None, type_)
1695 self.id = _cast(None, id)
1696 self.Object_Size = Object_Size
1697 self.Classifications = Classifications
1698 self.Associated_Code = Associated_Code
1699 self.Related_Objects = Related_Objects
1700 self.File_System_Object_Attributes = File_System_Object_Attributes
1701 self.GUI_Object_Attributes = GUI_Object_Attributes
1702 self.IPC_Object_Attributes = IPC_Object_Attributes
1703 self.Internet_Object_Attributes = Internet_Object_Attributes
1704 self.Module_Object_Attributes = Module_Object_Attributes
1705 self.Registry_Object_Attributes = Registry_Object_Attributes
1706 self.Process_Object_Attributes = Process_Object_Attributes
1707 self.Memory_Object_Attributes = Memory_Object_Attributes
1708 self.Network_Object_Attributes = Network_Object_Attributes
1709 self.Daemon_Object_Attributes = Daemon_Object_Attributes
1710 self.Custom_Object_Attributes = Custom_Object_Attributes
1716 factory = staticmethod(factory)
1752 - def set_type(self, type_): self.type_ = type_
1755 - def export(self, outfile, level, namespace_='maec:', name_='ObjectType', namespacedef_=''):
1756 showIndent(outfile, level)
1757 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
1758 already_processed = []
1759 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ObjectType')
1760 if self.hasContent_():
1761 outfile.write('>\n')
1762 self.exportChildren(outfile, level + 1, namespace_, name_)
1763 showIndent(outfile, level)
1764 outfile.write('</%s%s>\n' % (namespace_, name_))
1765 else:
1766 outfile.write('/>\n')
1767 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ObjectType'):
1768 if self.object_name is not None and 'object_name' not in already_processed:
1769 already_processed.append('object_name')
1770 outfile.write(' object_name=%s' % (self.gds_format_string(quote_attrib(self.object_name).encode(ExternalEncoding), input_name='object_name'), ))
1771 if self.permanent is not None and 'permanent' not in already_processed:
1772 already_processed.append('permanent')
1773 outfile.write(' permanent="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.permanent)), input_name='permanent'))
1774 if self.type_ is not None and 'type_' not in already_processed:
1775 already_processed.append('type_')
1776 outfile.write(' type=%s' % (quote_attrib(self.type_), ))
1777 if self.id is not None and 'id' not in already_processed:
1778 already_processed.append('id')
1779 outfile.write(' id=%s' % (quote_attrib(self.id), ))
1780 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ObjectType', fromsubclass_=False):
1781 if self.Object_Size is not None:
1782 self.Object_Size.export(outfile, level, namespace_, name_='Object_Size')
1783 if self.Classifications is not None:
1784 self.Classifications.export(outfile, level, namespace_, name_='Classifications')
1785 if self.Associated_Code is not None:
1786 self.Associated_Code.export(outfile, level, namespace_, name_='Associated_Code')
1787 if self.Related_Objects is not None:
1788 self.Related_Objects.export(outfile, level, namespace_, name_='Related_Objects')
1789 if self.File_System_Object_Attributes is not None:
1790 self.File_System_Object_Attributes.export(outfile, level, namespace_, name_='File_System_Object_Attributes')
1791 if self.GUI_Object_Attributes is not None:
1792 self.GUI_Object_Attributes.export(outfile, level, namespace_, name_='GUI_Object_Attributes')
1793 if self.IPC_Object_Attributes is not None:
1794 self.IPC_Object_Attributes.export(outfile, level, namespace_, name_='IPC_Object_Attributes')
1795 if self.Internet_Object_Attributes is not None:
1796 self.Internet_Object_Attributes.export(outfile, level, namespace_, name_='Internet_Object_Attributes')
1797 if self.Module_Object_Attributes is not None:
1798 self.Module_Object_Attributes.export(outfile, level, namespace_, name_='Module_Object_Attributes')
1799 if self.Registry_Object_Attributes is not None:
1800 self.Registry_Object_Attributes.export(outfile, level, namespace_, name_='Registry_Object_Attributes')
1801 if self.Process_Object_Attributes is not None:
1802 self.Process_Object_Attributes.export(outfile, level, namespace_, name_='Process_Object_Attributes')
1803 if self.Memory_Object_Attributes is not None:
1804 self.Memory_Object_Attributes.export(outfile, level, namespace_, name_='Memory_Object_Attributes')
1805 if self.Network_Object_Attributes is not None:
1806 self.Network_Object_Attributes.export(outfile, level, namespace_, name_='Network_Object_Attributes')
1807 if self.Daemon_Object_Attributes is not None:
1808 self.Daemon_Object_Attributes.export(outfile, level, namespace_, name_='Daemon_Object_Attributes')
1809 if self.Custom_Object_Attributes is not None:
1810 self.Custom_Object_Attributes.export(outfile, level, namespace_, name_='Custom_Object_Attributes')
1811 - def hasContent_(self):
1812 if (
1813 self.Object_Size is not None or
1814 self.Classifications is not None or
1815 self.Associated_Code is not None or
1816 self.Related_Objects is not None or
1817 self.File_System_Object_Attributes is not None or
1818 self.GUI_Object_Attributes is not None or
1819 self.IPC_Object_Attributes is not None or
1820 self.Internet_Object_Attributes is not None or
1821 self.Module_Object_Attributes is not None or
1822 self.Registry_Object_Attributes is not None or
1823 self.Process_Object_Attributes is not None or
1824 self.Memory_Object_Attributes is not None or
1825 self.Network_Object_Attributes is not None or
1826 self.Daemon_Object_Attributes is not None or
1827 self.Custom_Object_Attributes is not None
1828 ):
1829 return True
1830 else:
1831 return False
1838 if self.object_name is not None and 'object_name' not in already_processed:
1839 already_processed.append('object_name')
1840 showIndent(outfile, level)
1841 outfile.write('object_name = "%s",\n' % (self.object_name,))
1842 if self.permanent is not None and 'permanent' not in already_processed:
1843 already_processed.append('permanent')
1844 showIndent(outfile, level)
1845 outfile.write('permanent = %s,\n' % (self.permanent,))
1846 if self.type_ is not None and 'type_' not in already_processed:
1847 already_processed.append('type_')
1848 showIndent(outfile, level)
1849 outfile.write('type_ = %s,\n' % (self.type_,))
1850 if self.id is not None and 'id' not in already_processed:
1851 already_processed.append('id')
1852 showIndent(outfile, level)
1853 outfile.write('id = %s,\n' % (self.id,))
1855 if self.Object_Size is not None:
1856 showIndent(outfile, level)
1857 outfile.write('Object_Size=model_.Object_SizeType(\n')
1858 self.Object_Size.exportLiteral(outfile, level, name_='Object_Size')
1859 showIndent(outfile, level)
1860 outfile.write('),\n')
1861 if self.Classifications is not None:
1862 showIndent(outfile, level)
1863 outfile.write('Classifications=model_.ClassificationsType(\n')
1864 self.Classifications.exportLiteral(outfile, level, name_='Classifications')
1865 showIndent(outfile, level)
1866 outfile.write('),\n')
1867 if self.Associated_Code is not None:
1868 showIndent(outfile, level)
1869 outfile.write('Associated_Code=model_.Associated_CodeType(\n')
1870 self.Associated_Code.exportLiteral(outfile, level, name_='Associated_Code')
1871 showIndent(outfile, level)
1872 outfile.write('),\n')
1873 if self.Related_Objects is not None:
1874 showIndent(outfile, level)
1875 outfile.write('Related_Objects=model_.Related_ObjectsType(\n')
1876 self.Related_Objects.exportLiteral(outfile, level, name_='Related_Objects')
1877 showIndent(outfile, level)
1878 outfile.write('),\n')
1879 if self.File_System_Object_Attributes is not None:
1880 showIndent(outfile, level)
1881 outfile.write('File_System_Object_Attributes=model_.File_System_Object_AttributesType(\n')
1882 self.File_System_Object_Attributes.exportLiteral(outfile, level, name_='File_System_Object_Attributes')
1883 showIndent(outfile, level)
1884 outfile.write('),\n')
1885 if self.GUI_Object_Attributes is not None:
1886 showIndent(outfile, level)
1887 outfile.write('GUI_Object_Attributes=model_.GUI_Object_AttributesType(\n')
1888 self.GUI_Object_Attributes.exportLiteral(outfile, level, name_='GUI_Object_Attributes')
1889 showIndent(outfile, level)
1890 outfile.write('),\n')
1891 if self.IPC_Object_Attributes is not None:
1892 showIndent(outfile, level)
1893 outfile.write('IPC_Object_Attributes=model_.IPC_Object_AttributesType(\n')
1894 self.IPC_Object_Attributes.exportLiteral(outfile, level, name_='IPC_Object_Attributes')
1895 showIndent(outfile, level)
1896 outfile.write('),\n')
1897 if self.Internet_Object_Attributes is not None:
1898 showIndent(outfile, level)
1899 outfile.write('Internet_Object_Attributes=model_.Internet_Object_AttributesType(\n')
1900 self.Internet_Object_Attributes.exportLiteral(outfile, level, name_='Internet_Object_Attributes')
1901 showIndent(outfile, level)
1902 outfile.write('),\n')
1903 if self.Module_Object_Attributes is not None:
1904 showIndent(outfile, level)
1905 outfile.write('Module_Object_Attributes=model_.Module_Object_AttributesType(\n')
1906 self.Module_Object_Attributes.exportLiteral(outfile, level, name_='Module_Object_Attributes')
1907 showIndent(outfile, level)
1908 outfile.write('),\n')
1909 if self.Registry_Object_Attributes is not None:
1910 showIndent(outfile, level)
1911 outfile.write('Registry_Object_Attributes=model_.Registry_Object_AttributesType(\n')
1912 self.Registry_Object_Attributes.exportLiteral(outfile, level, name_='Registry_Object_Attributes')
1913 showIndent(outfile, level)
1914 outfile.write('),\n')
1915 if self.Process_Object_Attributes is not None:
1916 showIndent(outfile, level)
1917 outfile.write('Process_Object_Attributes=model_.Process_Object_AttributesType(\n')
1918 self.Process_Object_Attributes.exportLiteral(outfile, level, name_='Process_Object_Attributes')
1919 showIndent(outfile, level)
1920 outfile.write('),\n')
1921 if self.Memory_Object_Attributes is not None:
1922 showIndent(outfile, level)
1923 outfile.write('Memory_Object_Attributes=model_.Memory_Object_AttributesType(\n')
1924 self.Memory_Object_Attributes.exportLiteral(outfile, level, name_='Memory_Object_Attributes')
1925 showIndent(outfile, level)
1926 outfile.write('),\n')
1927 if self.Network_Object_Attributes is not None:
1928 showIndent(outfile, level)
1929 outfile.write('Network_Object_Attributes=model_.Network_Object_AttributesType(\n')
1930 self.Network_Object_Attributes.exportLiteral(outfile, level, name_='Network_Object_Attributes')
1931 showIndent(outfile, level)
1932 outfile.write('),\n')
1933 if self.Daemon_Object_Attributes is not None:
1934 showIndent(outfile, level)
1935 outfile.write('Daemon_Object_Attributes=model_.Daemon_Object_AttributesType(\n')
1936 self.Daemon_Object_Attributes.exportLiteral(outfile, level, name_='Daemon_Object_Attributes')
1937 showIndent(outfile, level)
1938 outfile.write('),\n')
1939 if self.Custom_Object_Attributes is not None:
1940 showIndent(outfile, level)
1941 outfile.write('Custom_Object_Attributes=model_.Custom_Object_AttributesType(\n')
1942 self.Custom_Object_Attributes.exportLiteral(outfile, level, name_='Custom_Object_Attributes')
1943 showIndent(outfile, level)
1944 outfile.write('),\n')
1951 value = find_attr_value_('object_name', node)
1952 if value is not None and 'object_name' not in already_processed:
1953 already_processed.append('object_name')
1954 self.object_name = value
1955 value = find_attr_value_('permanent', node)
1956 if value is not None and 'permanent' not in already_processed:
1957 already_processed.append('permanent')
1958 if value in ('true', '1'):
1959 self.permanent = True
1960 elif value in ('false', '0'):
1961 self.permanent = False
1962 else:
1963 raise_parse_error(node, 'Bad boolean attribute')
1964 value = find_attr_value_('type', node)
1965 if value is not None and 'type' not in already_processed:
1966 already_processed.append('type')
1967 self.type_ = value
1968 value = find_attr_value_('id', node)
1969 if value is not None and 'id' not in already_processed:
1970 already_processed.append('id')
1971 self.id = value
1972 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
2033
2034
2035
2037 """EffectType is intended to serve as a method for the characterization
2038 of the results of succesfully executed actions and behaviors."""
2039 subclass = None
2040 superclass = None
2041 - def __init__(self, id=None, Description=None, Affected_Objects=None, Constituent_Effects=None, Vulnerability_Exploit=None):
2042 self.id = _cast(None, id)
2043 self.Description = Description
2044 self.Affected_Objects = Affected_Objects
2045 self.Constituent_Effects = Constituent_Effects
2046 self.Vulnerability_Exploit = Vulnerability_Exploit
2052 factory = staticmethod(factory)
2063 - def export(self, outfile, level, namespace_='maec:', name_='EffectType', namespacedef_=''):
2064 showIndent(outfile, level)
2065 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
2066 already_processed = []
2067 self.exportAttributes(outfile, level, already_processed, namespace_, name_='EffectType')
2068 if self.hasContent_():
2069 outfile.write('>\n')
2070 self.exportChildren(outfile, level + 1, namespace_, name_)
2071 showIndent(outfile, level)
2072 outfile.write('</%s%s>\n' % (namespace_, name_))
2073 else:
2074 outfile.write('/>\n')
2075 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='EffectType'):
2076 if self.id is not None and 'id' not in already_processed:
2077 already_processed.append('id')
2078 outfile.write(' id=%s' % (quote_attrib(self.id), ))
2079 - def exportChildren(self, outfile, level, namespace_='maec:', name_='EffectType', fromsubclass_=False):
2080 if self.Description is not None:
2081 self.Description.export(outfile, level, namespace_, name_='Description')
2082 if self.Affected_Objects is not None:
2083 self.Affected_Objects.export(outfile, level, namespace_, name_='Affected_Objects')
2084 if self.Constituent_Effects is not None:
2085 self.Constituent_Effects.export(outfile, level, namespace_, name_='Constituent_Effects')
2086 if self.Vulnerability_Exploit is not None:
2087 self.Vulnerability_Exploit.export(outfile, level, namespace_, name_='Vulnerability_Exploit')
2088 - def hasContent_(self):
2089 if (
2090 self.Description is not None or
2091 self.Affected_Objects is not None or
2092 self.Constituent_Effects is not None or
2093 self.Vulnerability_Exploit is not None
2094 ):
2095 return True
2096 else:
2097 return False
2104 if self.id is not None and 'id' not in already_processed:
2105 already_processed.append('id')
2106 showIndent(outfile, level)
2107 outfile.write('id = %s,\n' % (self.id,))
2109 if self.Description is not None:
2110 showIndent(outfile, level)
2111 outfile.write('Description=model_.StructuredTextType(\n')
2112 self.Description.exportLiteral(outfile, level, name_='Description')
2113 showIndent(outfile, level)
2114 outfile.write('),\n')
2115 if self.Affected_Objects is not None:
2116 showIndent(outfile, level)
2117 outfile.write('Affected_Objects=model_.Affected_ObjectsType(\n')
2118 self.Affected_Objects.exportLiteral(outfile, level, name_='Affected_Objects')
2119 showIndent(outfile, level)
2120 outfile.write('),\n')
2121 if self.Constituent_Effects is not None:
2122 showIndent(outfile, level)
2123 outfile.write('Constituent_Effects=model_.Constituent_EffectsType(\n')
2124 self.Constituent_Effects.exportLiteral(outfile, level, name_='Constituent_Effects')
2125 showIndent(outfile, level)
2126 outfile.write('),\n')
2127 if self.Vulnerability_Exploit is not None:
2128 showIndent(outfile, level)
2129 outfile.write('Vulnerability_Exploit=model_.Vulnerability_ExploitType(\n')
2130 self.Vulnerability_Exploit.exportLiteral(outfile, level, name_='Vulnerability_Exploit')
2131 showIndent(outfile, level)
2132 outfile.write('),\n')
2139 value = find_attr_value_('id', node)
2140 if value is not None and 'id' not in already_processed:
2141 already_processed.append('id')
2142 self.id = value
2143 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
2160
2161
2162
2164 """EffectCollectionType is intended to provide a mechanism for
2165 characterizing collections of effects. For instance, it can be
2166 used to group all of the effects that result from the execution
2167 of a particular malware instance.The name attribute contains the
2168 name of the effect collection, if applicable."""
2169 subclass = None
2170 superclass = None
2171 - def __init__(self, id=None, name=None, Affinity_Type=None, Affinity_Degree=None, Description=None, Effect_Sub_Collection=None, Effect=None, Effect_Reference=None):
2172 self.id = _cast(None, id)
2173 self.name = _cast(None, name)
2174 self.Affinity_Type = Affinity_Type
2175 self.Affinity_Degree = Affinity_Degree
2176 self.Description = Description
2177 if Effect_Sub_Collection is None:
2178 self.Effect_Sub_Collection = []
2179 else:
2180 self.Effect_Sub_Collection = Effect_Sub_Collection
2181 if Effect is None:
2182 self.Effect = []
2183 else:
2184 self.Effect = Effect
2185 if Effect_Reference is None:
2186 self.Effect_Reference = []
2187 else:
2188 self.Effect_Reference = Effect_Reference
2194 factory = staticmethod(factory)
2206 - def set_Effect(self, Effect): self.Effect = Effect
2207 - def add_Effect(self, value): self.Effect.append(value)
2208 - def insert_Effect(self, index, value): self.Effect[index] = value
2217 - def export(self, outfile, level, namespace_='maec:', name_='EffectCollectionType', namespacedef_=''):
2218 showIndent(outfile, level)
2219 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
2220 already_processed = []
2221 self.exportAttributes(outfile, level, already_processed, namespace_, name_='EffectCollectionType')
2222 if self.hasContent_():
2223 outfile.write('>\n')
2224 self.exportChildren(outfile, level + 1, namespace_, name_)
2225 showIndent(outfile, level)
2226 outfile.write('</%s%s>\n' % (namespace_, name_))
2227 else:
2228 outfile.write('/>\n')
2229 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='EffectCollectionType'):
2230 if self.id is not None and 'id' not in already_processed:
2231 already_processed.append('id')
2232 outfile.write(' id=%s' % (quote_attrib(self.id), ))
2233 if self.name is not None and 'name' not in already_processed:
2234 already_processed.append('name')
2235 outfile.write(' name=%s' % (self.gds_format_string(quote_attrib(self.name).encode(ExternalEncoding), input_name='name'), ))
2236 - def exportChildren(self, outfile, level, namespace_='maec:', name_='EffectCollectionType', fromsubclass_=False):
2237 if self.Affinity_Type is not None:
2238 showIndent(outfile, level)
2239 outfile.write('<%sAffinity_Type>%s</%sAffinity_Type>\n' % (namespace_, self.gds_format_string(quote_xml(self.Affinity_Type).encode(ExternalEncoding), input_name='Affinity_Type'), namespace_))
2240 if self.Affinity_Degree is not None:
2241 showIndent(outfile, level)
2242 outfile.write('<%sAffinity_Degree>%s</%sAffinity_Degree>\n' % (namespace_, self.gds_format_string(quote_xml(self.Affinity_Degree).encode(ExternalEncoding), input_name='Affinity_Degree'), namespace_))
2243 if self.Description is not None:
2244 self.Description.export(outfile, level, namespace_, name_='Description')
2245 for Effect_Sub_Collection_ in self.Effect_Sub_Collection:
2246 Effect_Sub_Collection_.export(outfile, level, namespace_, name_='Effect_Sub_Collection')
2247 for Effect_ in self.Effect:
2248 Effect_.export(outfile, level, namespace_, name_='Effect')
2249 for Effect_Reference_ in self.Effect_Reference:
2250 Effect_Reference_.export(outfile, level, namespace_, name_='Effect_Reference')
2251 - def hasContent_(self):
2252 if (
2253 self.Affinity_Type is not None or
2254 self.Affinity_Degree is not None or
2255 self.Description is not None or
2256 self.Effect_Sub_Collection or
2257 self.Effect or
2258 self.Effect_Reference
2259 ):
2260 return True
2261 else:
2262 return False
2263 - def exportLiteral(self, outfile, level, name_='EffectCollectionType'):
2269 if self.id is not None and 'id' not in already_processed:
2270 already_processed.append('id')
2271 showIndent(outfile, level)
2272 outfile.write('id = %s,\n' % (self.id,))
2273 if self.name is not None and 'name' not in already_processed:
2274 already_processed.append('name')
2275 showIndent(outfile, level)
2276 outfile.write('name = "%s",\n' % (self.name,))
2278 if self.Affinity_Type is not None:
2279 showIndent(outfile, level)
2280 outfile.write('Affinity_Type=%s,\n' % quote_python(self.Affinity_Type).encode(ExternalEncoding))
2281 if self.Affinity_Degree is not None:
2282 showIndent(outfile, level)
2283 outfile.write('Affinity_Degree=%s,\n' % quote_python(self.Affinity_Degree).encode(ExternalEncoding))
2284 if self.Description is not None:
2285 showIndent(outfile, level)
2286 outfile.write('Description=model_.StructuredTextType(\n')
2287 self.Description.exportLiteral(outfile, level, name_='Description')
2288 showIndent(outfile, level)
2289 outfile.write('),\n')
2290 showIndent(outfile, level)
2291 outfile.write('Effect_Sub_Collection=[\n')
2292 level += 1
2293 for Effect_Sub_Collection_ in self.Effect_Sub_Collection:
2294 showIndent(outfile, level)
2295 outfile.write('model_.EffectCollectionType(\n')
2296 Effect_Sub_Collection_.exportLiteral(outfile, level, name_='EffectCollectionType')
2297 showIndent(outfile, level)
2298 outfile.write('),\n')
2299 level -= 1
2300 showIndent(outfile, level)
2301 outfile.write('],\n')
2302 showIndent(outfile, level)
2303 outfile.write('Effect=[\n')
2304 level += 1
2305 for Effect_ in self.Effect:
2306 showIndent(outfile, level)
2307 outfile.write('model_.EffectType(\n')
2308 Effect_.exportLiteral(outfile, level, name_='EffectType')
2309 showIndent(outfile, level)
2310 outfile.write('),\n')
2311 level -= 1
2312 showIndent(outfile, level)
2313 outfile.write('],\n')
2314 showIndent(outfile, level)
2315 outfile.write('Effect_Reference=[\n')
2316 level += 1
2317 for Effect_Reference_ in self.Effect_Reference:
2318 showIndent(outfile, level)
2319 outfile.write('model_.EffectReferenceType(\n')
2320 Effect_Reference_.exportLiteral(outfile, level, name_='EffectReferenceType')
2321 showIndent(outfile, level)
2322 outfile.write('),\n')
2323 level -= 1
2324 showIndent(outfile, level)
2325 outfile.write('],\n')
2332 value = find_attr_value_('id', node)
2333 if value is not None and 'id' not in already_processed:
2334 already_processed.append('id')
2335 self.id = value
2336 value = find_attr_value_('name', node)
2337 if value is not None and 'name' not in already_processed:
2338 already_processed.append('name')
2339 self.name = value
2340 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
2341 if nodeName_ == 'Affinity_Type':
2342 Affinity_Type_ = child_.text
2343 Affinity_Type_ = self.gds_validate_string(Affinity_Type_, node, 'Affinity_Type')
2344 self.Affinity_Type = Affinity_Type_
2345 elif nodeName_ == 'Affinity_Degree':
2346 Affinity_Degree_ = child_.text
2347 Affinity_Degree_ = self.gds_validate_string(Affinity_Degree_, node, 'Affinity_Degree')
2348 self.Affinity_Degree = Affinity_Degree_
2349 elif nodeName_ == 'Description':
2350 obj_ = StructuredTextType.factory()
2351 obj_.build(child_)
2352 self.set_Description(obj_)
2353 elif nodeName_ == 'Effect_Sub_Collection':
2354 obj_ = EffectCollectionType.factory()
2355 obj_.build(child_)
2356 self.Effect_Sub_Collection.append(obj_)
2357 elif nodeName_ == 'Effect':
2358 obj_ = EffectType.factory()
2359 obj_.build(child_)
2360 self.Effect.append(obj_)
2361 elif nodeName_ == 'Effect_Reference':
2362 obj_ = EffectReferenceType.factory()
2363 obj_.build(child_)
2364 self.Effect_Reference.append(obj_)
2365
2366
2367
2369 """EffectReferenceType is intended to serve as a method for linking to
2370 effects.The effect_id attribute refers to the ID of the effect
2371 being referenced.The type attribute refers to the type of effect
2372 entity that is being referenced. Possible values: Effect,
2373 Effect_Collection."""
2374 subclass = None
2375 superclass = None
2376 - def __init__(self, type_=None, effect_id=None):
2377 self.type_ = _cast(None, type_)
2378 self.effect_id = _cast(None, effect_id)
2379 pass
2385 factory = staticmethod(factory)
2387 - def set_type(self, type_): self.type_ = type_
2390 - def export(self, outfile, level, namespace_='maec:', name_='EffectReferenceType', namespacedef_=''):
2391 showIndent(outfile, level)
2392 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
2393 already_processed = []
2394 self.exportAttributes(outfile, level, already_processed, namespace_, name_='EffectReferenceType')
2395 if self.hasContent_():
2396 outfile.write('>\n')
2397 self.exportChildren(outfile, level + 1, namespace_, name_)
2398 outfile.write('</%s%s>\n' % (namespace_, name_))
2399 else:
2400 outfile.write('/>\n')
2401 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='EffectReferenceType'):
2402 if self.type_ is not None and 'type_' not in already_processed:
2403 already_processed.append('type_')
2404 outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))
2405 if self.effect_id is not None and 'effect_id' not in already_processed:
2406 already_processed.append('effect_id')
2407 outfile.write(' effect_id=%s' % (quote_attrib(self.effect_id), ))
2408 - def exportChildren(self, outfile, level, namespace_='maec:', name_='EffectReferenceType', fromsubclass_=False):
2410 - def hasContent_(self):
2411 if (
2412
2413 ):
2414 return True
2415 else:
2416 return False
2417 - def exportLiteral(self, outfile, level, name_='EffectReferenceType'):
2423 if self.type_ is not None and 'type_' not in already_processed:
2424 already_processed.append('type_')
2425 showIndent(outfile, level)
2426 outfile.write('type_ = "%s",\n' % (self.type_,))
2427 if self.effect_id is not None and 'effect_id' not in already_processed:
2428 already_processed.append('effect_id')
2429 showIndent(outfile, level)
2430 outfile.write('effect_id = %s,\n' % (self.effect_id,))
2439 value = find_attr_value_('type', node)
2440 if value is not None and 'type' not in already_processed:
2441 already_processed.append('type')
2442 self.type_ = value
2443 value = find_attr_value_('effect_id', node)
2444 if value is not None and 'effect_id' not in already_processed:
2445 already_processed.append('effect_id')
2446 self.effect_id = value
2447 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
2449
2450
2451
2452 -class StructuredTextType(GeneratedsSuper):
2453 subclass = None
2454 superclass = None
2455 - def __init__(self, Text_Title=None, Text=None, Code_Example_Language=None, Code=None, Images=None, Block=None):
2456 if Text_Title is None:
2457 self.Text_Title = []
2458 else:
2459 self.Text_Title = Text_Title
2460 if Text is None:
2461 self.Text = []
2462 else:
2463 self.Text = Text
2464 if Code_Example_Language is None:
2465 self.Code_Example_Language = []
2466 else:
2467 self.Code_Example_Language = Code_Example_Language
2468 if Code is None:
2469 self.Code = []
2470 else:
2471 self.Code = Code
2472 self.Images = Images
2473 self.Block = Block
2474 - def factory(*args_, **kwargs_):
2475 if StructuredTextType.subclass:
2476 return StructuredTextType.subclass(*args_, **kwargs_)
2477 else:
2478 return StructuredTextType(*args_, **kwargs_)
2479 factory = staticmethod(factory)
2480 - def get_Text_Title(self): return self.Text_Title
2481 - def set_Text_Title(self, Text_Title): self.Text_Title = Text_Title
2482 - def add_Text_Title(self, value): self.Text_Title.append(value)
2483 - def insert_Text_Title(self, index, value): self.Text_Title[index] = value
2484 - def get_Text(self): return self.Text
2485 - def set_Text(self, Text): self.Text = Text
2486 - def add_Text(self, value): self.Text.append(value)
2487 - def insert_Text(self, index, value): self.Text[index] = value
2488 - def get_Code_Example_Language(self): return self.Code_Example_Language
2489 - def set_Code_Example_Language(self, Code_Example_Language): self.Code_Example_Language = Code_Example_Language
2490 - def add_Code_Example_Language(self, value): self.Code_Example_Language.append(value)
2491 - def insert_Code_Example_Language(self, index, value): self.Code_Example_Language[index] = value
2492 - def validate_LanguageEnum(self, value):
2495 - def get_Code(self): return self.Code
2496 - def set_Code(self, Code): self.Code = Code
2497 - def add_Code(self, value): self.Code.append(value)
2498 - def insert_Code(self, index, value): self.Code[index] = value
2499 - def get_Images(self): return self.Images
2500 - def set_Images(self, Images): self.Images = Images
2501 - def get_Block(self): return self.Block
2502 - def set_Block(self, Block): self.Block = Block
2503 - def export(self, outfile, level, namespace_='maec:', name_='StructuredTextType', namespacedef_=''):
2504 showIndent(outfile, level)
2505 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
2506 already_processed = []
2507 self.exportAttributes(outfile, level, already_processed, namespace_, name_='StructuredTextType')
2508 if self.hasContent_():
2509 outfile.write('>\n')
2510 self.exportChildren(outfile, level + 1, namespace_, name_)
2511 showIndent(outfile, level)
2512 outfile.write('</%s%s>\n' % (namespace_, name_))
2513 else:
2514 outfile.write('/>\n')
2515 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='StructuredTextType'):
2517 - def exportChildren(self, outfile, level, namespace_='maec:', name_='StructuredTextType', fromsubclass_=False):
2518 for Text_Title_ in self.Text_Title:
2519 showIndent(outfile, level)
2520 outfile.write('<%sText_Title>%s</%sText_Title>\n' % (namespace_, self.gds_format_string(quote_xml(Text_Title_).encode(ExternalEncoding), input_name='Text_Title'), namespace_))
2521 for Text_ in self.Text:
2522 showIndent(outfile, level)
2523 outfile.write('<%sText>%s</%sText>\n' % (namespace_, self.gds_format_string(quote_xml(Text_).encode(ExternalEncoding), input_name='Text'), namespace_))
2524 for Code_Example_Language_ in self.Code_Example_Language:
2525 showIndent(outfile, level)
2526 outfile.write('<%sCode_Example_Language>%s</%sCode_Example_Language>\n' % (namespace_, self.gds_format_string(quote_xml(Code_Example_Language_).encode(ExternalEncoding), input_name='Code_Example_Language'), namespace_))
2527 for Code_ in self.Code:
2528 showIndent(outfile, level)
2529 outfile.write('<%sCode>%s</%sCode>\n' % (namespace_, self.gds_format_string(quote_xml(Code_).encode(ExternalEncoding), input_name='Code'), namespace_))
2530 if self.Images is not None:
2531 self.Images.export(outfile, level, namespace_, name_='Images')
2532 if self.Block is not None:
2533 self.Block.export(outfile, level, namespace_, name_='Block', )
2534 - def hasContent_(self):
2535 if (
2536 self.Text_Title or
2537 self.Text or
2538 self.Code_Example_Language or
2539 self.Code or
2540 self.Images is not None or
2541 self.Block is not None
2542 ):
2543 return True
2544 else:
2545 return False
2546 - def exportLiteral(self, outfile, level, name_='StructuredTextType'):
2547 level += 1
2548 self.exportLiteralAttributes(outfile, level, [], name_)
2549 if self.hasContent_():
2550 self.exportLiteralChildren(outfile, level, name_)
2551 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
2553 - def exportLiteralChildren(self, outfile, level, name_):
2554 showIndent(outfile, level)
2555 outfile.write('Text_Title=[\n')
2556 level += 1
2557 for Text_Title_ in self.Text_Title:
2558 showIndent(outfile, level)
2559 outfile.write('%s,\n' % quote_python(Text_Title_).encode(ExternalEncoding))
2560 level -= 1
2561 showIndent(outfile, level)
2562 outfile.write('],\n')
2563 showIndent(outfile, level)
2564 outfile.write('Text=[\n')
2565 level += 1
2566 for Text_ in self.Text:
2567 showIndent(outfile, level)
2568 outfile.write('%s,\n' % quote_python(Text_).encode(ExternalEncoding))
2569 level -= 1
2570 showIndent(outfile, level)
2571 outfile.write('],\n')
2572 showIndent(outfile, level)
2573 outfile.write('Code_Example_Language=[\n')
2574 level += 1
2575 for Code_Example_Language_ in self.Code_Example_Language:
2576 showIndent(outfile, level)
2577 outfile.write('%s,\n' % quote_python(Code_Example_Language_).encode(ExternalEncoding))
2578 level -= 1
2579 showIndent(outfile, level)
2580 outfile.write('],\n')
2581 showIndent(outfile, level)
2582 outfile.write('Code=[\n')
2583 level += 1
2584 for Code_ in self.Code:
2585 showIndent(outfile, level)
2586 outfile.write('%s,\n' % quote_python(Code_).encode(ExternalEncoding))
2587 level -= 1
2588 showIndent(outfile, level)
2589 outfile.write('],\n')
2590 if self.Images is not None:
2591 showIndent(outfile, level)
2592 outfile.write('Images=model_.ImagesType(\n')
2593 self.Images.exportLiteral(outfile, level, name_='Images')
2594 showIndent(outfile, level)
2595 outfile.write('),\n')
2596 if self.Block is not None:
2597 showIndent(outfile, level)
2598 outfile.write('Block=model_.Block(\n')
2599 self.Block.exportLiteral(outfile, level)
2600 showIndent(outfile, level)
2601 outfile.write('),\n')
2602 - def build(self, node):
2603 self.buildAttributes(node, node.attrib, [])
2604 for child in node:
2605 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
2606 self.buildChildren(child, node, nodeName_)
2607 - def buildAttributes(self, node, attrs, already_processed):
2609 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
2610 if nodeName_ == 'Text_Title':
2611 Text_Title_ = child_.text
2612 Text_Title_ = self.gds_validate_string(Text_Title_, node, 'Text_Title')
2613 self.Text_Title.append(Text_Title_)
2614 elif nodeName_ == 'Text':
2615 Text_ = child_.text
2616 Text_ = self.gds_validate_string(Text_, node, 'Text')
2617 self.Text.append(Text_)
2618 elif nodeName_ == 'Code_Example_Language':
2619 Code_Example_Language_ = child_.text
2620 Code_Example_Language_ = self.gds_validate_string(Code_Example_Language_, node, 'Code_Example_Language')
2621 self.Code_Example_Language.append(Code_Example_Language_)
2622 self.validate_LanguageEnum(self.Code_Example_Language)
2623 elif nodeName_ == 'Code':
2624 Code_ = child_.text
2625 Code_ = self.gds_validate_string(Code_, node, 'Code')
2626 self.Code.append(Code_)
2627 elif nodeName_ == 'Images':
2628 obj_ = ImagesType.factory()
2629 obj_.build(child_)
2630 self.set_Images(obj_)
2631 elif nodeName_ == 'Block':
2632 obj_ = Block.factory()
2633 obj_.build(child_)
2634 self.set_Block(obj_)
2635
2636
2637
2638 -class Block(GeneratedsSuper):
2639 """Block is a Structured_Text element consisting of one of Text_Title,
2640 Text, Code_Example_Language, or Code followed by another Block
2641 element. Structured_Text elements help define whitespace and
2642 text segments. This attribute identifies the nature of the
2643 content containedwithin the Block."""
2644 subclass = None
2645 superclass = None
2646 - def __init__(self, Block_Nature=None, Text_Title=None, Text=None, Code_Example_Language=None, Code=None, Images=None, Block=None):
2647 self.Block_Nature = _cast(None, Block_Nature)
2648 if Text_Title is None:
2649 self.Text_Title = []
2650 else:
2651 self.Text_Title = Text_Title
2652 if Text is None:
2653 self.Text = []
2654 else:
2655 self.Text = Text
2656 if Code_Example_Language is None:
2657 self.Code_Example_Language = []
2658 else:
2659 self.Code_Example_Language = Code_Example_Language
2660 if Code is None:
2661 self.Code = []
2662 else:
2663 self.Code = Code
2664 self.Images = Images
2665 self.Block = Block
2671 factory = staticmethod(factory)
2672 - def get_Text_Title(self): return self.Text_Title
2673 - def set_Text_Title(self, Text_Title): self.Text_Title = Text_Title
2674 - def add_Text_Title(self, value): self.Text_Title.append(value)
2675 - def insert_Text_Title(self, index, value): self.Text_Title[index] = value
2676 - def get_Text(self): return self.Text
2677 - def set_Text(self, Text): self.Text = Text
2678 - def add_Text(self, value): self.Text.append(value)
2679 - def insert_Text(self, index, value): self.Text[index] = value
2688 - def set_Code(self, Code): self.Code = Code
2689 - def add_Code(self, value): self.Code.append(value)
2690 - def insert_Code(self, index, value): self.Code[index] = value
2692 - def set_Images(self, Images): self.Images = Images
2697 - def export(self, outfile, level, namespace_='maec:', name_='Block', namespacedef_=''):
2698 showIndent(outfile, level)
2699 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
2700 already_processed = []
2701 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Block')
2702 if self.hasContent_():
2703 outfile.write('>\n')
2704 self.exportChildren(outfile, level + 1, namespace_, name_)
2705 showIndent(outfile, level)
2706 outfile.write('</%s%s>\n' % (namespace_, name_))
2707 else:
2708 outfile.write('/>\n')
2709 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Block'):
2710 if self.Block_Nature is not None and 'Block_Nature' not in already_processed:
2711 already_processed.append('Block_Nature')
2712 outfile.write(' Block_Nature=%s' % (self.gds_format_string(quote_attrib(self.Block_Nature).encode(ExternalEncoding), input_name='Block_Nature'), ))
2713 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Block', fromsubclass_=False):
2714 for Text_Title_ in self.Text_Title:
2715 showIndent(outfile, level)
2716 outfile.write('<%sText_Title>%s</%sText_Title>\n' % (namespace_, self.gds_format_string(quote_xml(Text_Title_).encode(ExternalEncoding), input_name='Text_Title'), namespace_))
2717 for Text_ in self.Text:
2718 showIndent(outfile, level)
2719 outfile.write('<%sText>%s</%sText>\n' % (namespace_, self.gds_format_string(quote_xml(Text_).encode(ExternalEncoding), input_name='Text'), namespace_))
2720 for Code_Example_Language_ in self.Code_Example_Language:
2721 showIndent(outfile, level)
2722 outfile.write('<%sCode_Example_Language>%s</%sCode_Example_Language>\n' % (namespace_, self.gds_format_string(quote_xml(Code_Example_Language_).encode(ExternalEncoding), input_name='Code_Example_Language'), namespace_))
2723 for Code_ in self.Code:
2724 showIndent(outfile, level)
2725 outfile.write('<%sCode>%s</%sCode>\n' % (namespace_, self.gds_format_string(quote_xml(Code_).encode(ExternalEncoding), input_name='Code'), namespace_))
2726 if self.Images is not None:
2727 self.Images.export(outfile, level, namespace_, name_='Images')
2728 if self.Block is not None:
2729 self.Block.export(outfile, level, namespace_, name_='Block', )
2730 - def hasContent_(self):
2731 if (
2732 self.Text_Title or
2733 self.Text or
2734 self.Code_Example_Language or
2735 self.Code or
2736 self.Images is not None or
2737 self.Block is not None
2738 ):
2739 return True
2740 else:
2741 return False
2748 if self.Block_Nature is not None and 'Block_Nature' not in already_processed:
2749 already_processed.append('Block_Nature')
2750 showIndent(outfile, level)
2751 outfile.write('Block_Nature = "%s",\n' % (self.Block_Nature,))
2753 showIndent(outfile, level)
2754 outfile.write('Text_Title=[\n')
2755 level += 1
2756 for Text_Title_ in self.Text_Title:
2757 showIndent(outfile, level)
2758 outfile.write('%s,\n' % quote_python(Text_Title_).encode(ExternalEncoding))
2759 level -= 1
2760 showIndent(outfile, level)
2761 outfile.write('],\n')
2762 showIndent(outfile, level)
2763 outfile.write('Text=[\n')
2764 level += 1
2765 for Text_ in self.Text:
2766 showIndent(outfile, level)
2767 outfile.write('%s,\n' % quote_python(Text_).encode(ExternalEncoding))
2768 level -= 1
2769 showIndent(outfile, level)
2770 outfile.write('],\n')
2771 showIndent(outfile, level)
2772 outfile.write('Code_Example_Language=[\n')
2773 level += 1
2774 for Code_Example_Language_ in self.Code_Example_Language:
2775 showIndent(outfile, level)
2776 outfile.write('%s,\n' % quote_python(Code_Example_Language_).encode(ExternalEncoding))
2777 level -= 1
2778 showIndent(outfile, level)
2779 outfile.write('],\n')
2780 showIndent(outfile, level)
2781 outfile.write('Code=[\n')
2782 level += 1
2783 for Code_ in self.Code:
2784 showIndent(outfile, level)
2785 outfile.write('%s,\n' % quote_python(Code_).encode(ExternalEncoding))
2786 level -= 1
2787 showIndent(outfile, level)
2788 outfile.write('],\n')
2789 if self.Images is not None:
2790 showIndent(outfile, level)
2791 outfile.write('Images=model_.ImagesType2(\n')
2792 self.Images.exportLiteral(outfile, level, name_='Images')
2793 showIndent(outfile, level)
2794 outfile.write('),\n')
2795 if self.Block is not None:
2796 showIndent(outfile, level)
2797 outfile.write('Block=model_.Block(\n')
2798 self.Block.exportLiteral(outfile, level)
2799 showIndent(outfile, level)
2800 outfile.write('),\n')
2807 value = find_attr_value_('Block_Nature', node)
2808 if value is not None and 'Block_Nature' not in already_processed:
2809 already_processed.append('Block_Nature')
2810 self.Block_Nature = value
2811 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
2812 if nodeName_ == 'Text_Title':
2813 Text_Title_ = child_.text
2814 Text_Title_ = self.gds_validate_string(Text_Title_, node, 'Text_Title')
2815 self.Text_Title.append(Text_Title_)
2816 elif nodeName_ == 'Text':
2817 Text_ = child_.text
2818 Text_ = self.gds_validate_string(Text_, node, 'Text')
2819 self.Text.append(Text_)
2820 elif nodeName_ == 'Code_Example_Language':
2821 Code_Example_Language_ = child_.text
2822 Code_Example_Language_ = self.gds_validate_string(Code_Example_Language_, node, 'Code_Example_Language')
2823 self.Code_Example_Language.append(Code_Example_Language_)
2824 self.validate_LanguageEnum(self.Code_Example_Language)
2825 elif nodeName_ == 'Code':
2826 Code_ = child_.text
2827 Code_ = self.gds_validate_string(Code_, node, 'Code')
2828 self.Code.append(Code_)
2829 elif nodeName_ == 'Images':
2830 obj_ = ImagesType2.factory()
2831 obj_.build(child_)
2832 self.set_Images(obj_)
2833 elif nodeName_ == 'Block':
2834 obj_ = Block.factory()
2835 obj_.build(child_)
2836 self.set_Block(obj_)
2837
2838
2839
2841 """ActionImplementationType is intended to serve as a method for the
2842 characterization of action implementations. Currently supported
2843 are implementation achieved through API function calls and
2844 abstractly defined code. The type attribute refers to the type
2845 of action implementation being characterized. Possible values:
2846 API_Call, Code, Other."""
2847 subclass = None
2848 superclass = None
2849 - def __init__(self, type_=None, id=None, API_Call=None, Code=None, Platform=None, Data_Read=None, Data_Written=None, File_System_Action_Attributes=None, IPC_Action_Attributes=None, Process_Action_Attributes=None, Memory_Action_Attributes=None, Registry_Action_Attributes=None, Network_Action_Attributes=None, Module_Action_Attributes=None, Daemon_Action_Attributes=None, System_Action_Attributes=None, Internet_Action_Attributes=None):
2850 self.type_ = _cast(None, type_)
2851 self.id = _cast(None, id)
2852 self.API_Call = API_Call
2853 if Code is None:
2854 self.Code = []
2855 else:
2856 self.Code = Code
2857 self.Platform = Platform
2858 self.Data_Read = Data_Read
2859 self.Data_Written = Data_Written
2860 self.File_System_Action_Attributes = File_System_Action_Attributes
2861 self.IPC_Action_Attributes = IPC_Action_Attributes
2862 self.Process_Action_Attributes = Process_Action_Attributes
2863 self.Memory_Action_Attributes = Memory_Action_Attributes
2864 self.Registry_Action_Attributes = Registry_Action_Attributes
2865 self.Network_Action_Attributes = Network_Action_Attributes
2866 self.Module_Action_Attributes = Module_Action_Attributes
2867 self.Daemon_Action_Attributes = Daemon_Action_Attributes
2868 self.System_Action_Attributes = System_Action_Attributes
2869 self.Internet_Action_Attributes = Internet_Action_Attributes
2875 factory = staticmethod(factory)
2877 - def set_API_Call(self, API_Call): self.API_Call = API_Call
2879 - def set_Code(self, Code): self.Code = Code
2880 - def add_Code(self, value): self.Code.append(value)
2881 - def insert_Code(self, index, value): self.Code[index] = value
2909 - def set_type(self, type_): self.type_ = type_
2912 - def export(self, outfile, level, namespace_='maec:', name_='ActionImplementationType', namespacedef_=''):
2913 showIndent(outfile, level)
2914 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
2915 already_processed = []
2916 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ActionImplementationType')
2917 if self.hasContent_():
2918 outfile.write('>\n')
2919 self.exportChildren(outfile, level + 1, namespace_, name_)
2920 showIndent(outfile, level)
2921 outfile.write('</%s%s>\n' % (namespace_, name_))
2922 else:
2923 outfile.write('/>\n')
2924 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ActionImplementationType'):
2925 if self.type_ is not None and 'type_' not in already_processed:
2926 already_processed.append('type_')
2927 outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))
2928 if self.id is not None and 'id' not in already_processed:
2929 already_processed.append('id')
2930 outfile.write(' id=%s' % (quote_attrib(self.id), ))
2931 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ActionImplementationType', fromsubclass_=False):
2932 if self.API_Call is not None:
2933 self.API_Call.export(outfile, level, namespace_, name_='API_Call')
2934 for Code_ in self.Code:
2935 Code_.export(outfile, level, namespace_, name_='Code')
2936 if self.Platform is not None:
2937 self.Platform.export(outfile, level, namespace_, name_='Platform')
2938 if self.Data_Read is not None:
2939 self.Data_Read.export(outfile, level, namespace_, name_='Data_Read')
2940 if self.Data_Written is not None:
2941 self.Data_Written.export(outfile, level, namespace_, name_='Data_Written')
2942 if self.File_System_Action_Attributes is not None:
2943 self.File_System_Action_Attributes.export(outfile, level, namespace_, name_='File_System_Action_Attributes')
2944 if self.IPC_Action_Attributes is not None:
2945 self.IPC_Action_Attributes.export(outfile, level, namespace_, name_='IPC_Action_Attributes')
2946 if self.Process_Action_Attributes is not None:
2947 self.Process_Action_Attributes.export(outfile, level, namespace_, name_='Process_Action_Attributes')
2948 if self.Memory_Action_Attributes is not None:
2949 self.Memory_Action_Attributes.export(outfile, level, namespace_, name_='Memory_Action_Attributes')
2950 if self.Registry_Action_Attributes is not None:
2951 self.Registry_Action_Attributes.export(outfile, level, namespace_, name_='Registry_Action_Attributes')
2952 if self.Network_Action_Attributes is not None:
2953 self.Network_Action_Attributes.export(outfile, level, namespace_, name_='Network_Action_Attributes')
2954 if self.Module_Action_Attributes is not None:
2955 self.Module_Action_Attributes.export(outfile, level, namespace_, name_='Module_Action_Attributes')
2956 if self.Daemon_Action_Attributes is not None:
2957 self.Daemon_Action_Attributes.export(outfile, level, namespace_, name_='Daemon_Action_Attributes')
2958 if self.System_Action_Attributes is not None:
2959 self.System_Action_Attributes.export(outfile, level, namespace_, name_='System_Action_Attributes')
2960 if self.Internet_Action_Attributes is not None:
2961 self.Internet_Action_Attributes.export(outfile, level, namespace_, name_='Internet_Action_Attributes')
2962 - def hasContent_(self):
2963 if (
2964 self.API_Call is not None or
2965 self.Code or
2966 self.Platform is not None or
2967 self.Data_Read is not None or
2968 self.Data_Written is not None or
2969 self.File_System_Action_Attributes is not None or
2970 self.IPC_Action_Attributes is not None or
2971 self.Process_Action_Attributes is not None or
2972 self.Memory_Action_Attributes is not None or
2973 self.Registry_Action_Attributes is not None or
2974 self.Network_Action_Attributes is not None or
2975 self.Module_Action_Attributes is not None or
2976 self.Daemon_Action_Attributes is not None or
2977 self.System_Action_Attributes is not None or
2978 self.Internet_Action_Attributes is not None
2979 ):
2980 return True
2981 else:
2982 return False
2983 - def exportLiteral(self, outfile, level, name_='ActionImplementationType'):
2989 if self.type_ is not None and 'type_' not in already_processed:
2990 already_processed.append('type_')
2991 showIndent(outfile, level)
2992 outfile.write('type_ = "%s",\n' % (self.type_,))
2993 if self.id is not None and 'id' not in already_processed:
2994 already_processed.append('id')
2995 showIndent(outfile, level)
2996 outfile.write('id = %s,\n' % (self.id,))
2998 if self.API_Call is not None:
2999 showIndent(outfile, level)
3000 outfile.write('API_Call=model_.APICallType(\n')
3001 self.API_Call.exportLiteral(outfile, level, name_='API_Call')
3002 showIndent(outfile, level)
3003 outfile.write('),\n')
3004 showIndent(outfile, level)
3005 outfile.write('Code=[\n')
3006 level += 1
3007 for Code_ in self.Code:
3008 showIndent(outfile, level)
3009 outfile.write('model_.CodeType(\n')
3010 Code_.exportLiteral(outfile, level, name_='CodeType')
3011 showIndent(outfile, level)
3012 outfile.write('),\n')
3013 level -= 1
3014 showIndent(outfile, level)
3015 outfile.write('],\n')
3016 if self.Platform is not None:
3017 showIndent(outfile, level)
3018 outfile.write('Platform=model_.CPESpecificationType(\n')
3019 self.Platform.exportLiteral(outfile, level, name_='Platform')
3020 showIndent(outfile, level)
3021 outfile.write('),\n')
3022 if self.Data_Read is not None:
3023 showIndent(outfile, level)
3024 outfile.write('Data_Read=model_.DataType(\n')
3025 self.Data_Read.exportLiteral(outfile, level, name_='Data_Read')
3026 showIndent(outfile, level)
3027 outfile.write('),\n')
3028 if self.Data_Written is not None:
3029 showIndent(outfile, level)
3030 outfile.write('Data_Written=model_.DataType(\n')
3031 self.Data_Written.exportLiteral(outfile, level, name_='Data_Written')
3032 showIndent(outfile, level)
3033 outfile.write('),\n')
3034 if self.File_System_Action_Attributes is not None:
3035 showIndent(outfile, level)
3036 outfile.write('File_System_Action_Attributes=model_.File_System_Action_AttributesType(\n')
3037 self.File_System_Action_Attributes.exportLiteral(outfile, level, name_='File_System_Action_Attributes')
3038 showIndent(outfile, level)
3039 outfile.write('),\n')
3040 if self.IPC_Action_Attributes is not None:
3041 showIndent(outfile, level)
3042 outfile.write('IPC_Action_Attributes=model_.IPC_Action_AttributesType(\n')
3043 self.IPC_Action_Attributes.exportLiteral(outfile, level, name_='IPC_Action_Attributes')
3044 showIndent(outfile, level)
3045 outfile.write('),\n')
3046 if self.Process_Action_Attributes is not None:
3047 showIndent(outfile, level)
3048 outfile.write('Process_Action_Attributes=model_.Process_Action_AttributesType(\n')
3049 self.Process_Action_Attributes.exportLiteral(outfile, level, name_='Process_Action_Attributes')
3050 showIndent(outfile, level)
3051 outfile.write('),\n')
3052 if self.Memory_Action_Attributes is not None:
3053 showIndent(outfile, level)
3054 outfile.write('Memory_Action_Attributes=model_.Memory_Action_AttributesType(\n')
3055 self.Memory_Action_Attributes.exportLiteral(outfile, level, name_='Memory_Action_Attributes')
3056 showIndent(outfile, level)
3057 outfile.write('),\n')
3058 if self.Registry_Action_Attributes is not None:
3059 showIndent(outfile, level)
3060 outfile.write('Registry_Action_Attributes=model_.Registry_Action_AttributesType(\n')
3061 self.Registry_Action_Attributes.exportLiteral(outfile, level, name_='Registry_Action_Attributes')
3062 showIndent(outfile, level)
3063 outfile.write('),\n')
3064 if self.Network_Action_Attributes is not None:
3065 showIndent(outfile, level)
3066 outfile.write('Network_Action_Attributes=model_.Network_Action_AttributesType(\n')
3067 self.Network_Action_Attributes.exportLiteral(outfile, level, name_='Network_Action_Attributes')
3068 showIndent(outfile, level)
3069 outfile.write('),\n')
3070 if self.Module_Action_Attributes is not None:
3071 showIndent(outfile, level)
3072 outfile.write('Module_Action_Attributes=model_.Module_Action_AttributesType(\n')
3073 self.Module_Action_Attributes.exportLiteral(outfile, level, name_='Module_Action_Attributes')
3074 showIndent(outfile, level)
3075 outfile.write('),\n')
3076 if self.Daemon_Action_Attributes is not None:
3077 showIndent(outfile, level)
3078 outfile.write('Daemon_Action_Attributes=model_.Daemon_Action_AttributesType(\n')
3079 self.Daemon_Action_Attributes.exportLiteral(outfile, level, name_='Daemon_Action_Attributes')
3080 showIndent(outfile, level)
3081 outfile.write('),\n')
3082 if self.System_Action_Attributes is not None:
3083 showIndent(outfile, level)
3084 outfile.write('System_Action_Attributes=model_.System_Action_AttributesType(\n')
3085 self.System_Action_Attributes.exportLiteral(outfile, level, name_='System_Action_Attributes')
3086 showIndent(outfile, level)
3087 outfile.write('),\n')
3088 if self.Internet_Action_Attributes is not None:
3089 showIndent(outfile, level)
3090 outfile.write('Internet_Action_Attributes=model_.Internet_Action_AttributesType(\n')
3091 self.Internet_Action_Attributes.exportLiteral(outfile, level, name_='Internet_Action_Attributes')
3092 showIndent(outfile, level)
3093 outfile.write('),\n')
3100 value = find_attr_value_('type', node)
3101 if value is not None and 'type' not in already_processed:
3102 already_processed.append('type')
3103 self.type_ = value
3104 value = find_attr_value_('id', node)
3105 if value is not None and 'id' not in already_processed:
3106 already_processed.append('id')
3107 self.id = value
3108 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
3169
3170
3171
3173 """CPESpecificationType is a modularized data type intended for
3174 providing a consistent approach to uniquely specifying the
3175 identity of a specific platform using the Common Platform
3176 Enumeration (CPE) naming standard. http://cpe.mitre.org/The
3177 cpe_name attribute contains the CPE Name value for the relevant
3178 platform. A CPE Name is a percent-encoded URI with each name
3179 starting with the prefix (the URI scheme name) "cpe:". The
3180 remainder of the name consists of colon separated values
3181 representing the CPE part, vendor, product, version, update,
3182 edition and language (i.e. cpe:/ {part} : {vendor} : {product} :
3183 {version} : {update} : {edition} : {language}).The xmlns_value
3184 attribute contains the XML namespace descriptor for the CPE
3185 namespace relevant to this CPE Name use."""
3186 subclass = None
3187 superclass = None
3188 - def __init__(self, cpe_name=None, xmlns_value=None, Title=None, meta_item_metadata=None):
3189 self.cpe_name = _cast(None, cpe_name)
3190 self.xmlns_value = _cast(None, xmlns_value)
3191 self.Title = Title
3192 self.meta_item_metadata = meta_item_metadata
3198 factory = staticmethod(factory)
3200 - def set_Title(self, Title): self.Title = Title
3204 - def set_cpe_name(self, cpe_name): self.cpe_name = cpe_name
3207 - def export(self, outfile, level, namespace_='maec:', name_='CPESpecificationType', namespacedef_=''):
3208 showIndent(outfile, level)
3209 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
3210 already_processed = []
3211 self.exportAttributes(outfile, level, already_processed, namespace_, name_='CPESpecificationType')
3212 if self.hasContent_():
3213 outfile.write('>\n')
3214 self.exportChildren(outfile, level + 1, namespace_, name_)
3215 showIndent(outfile, level)
3216 outfile.write('</%s%s>\n' % (namespace_, name_))
3217 else:
3218 outfile.write('/>\n')
3219 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='CPESpecificationType'):
3220 if self.cpe_name is not None and 'cpe_name' not in already_processed:
3221 already_processed.append('cpe_name')
3222 outfile.write(' cpe_name=%s' % (self.gds_format_string(quote_attrib(self.cpe_name).encode(ExternalEncoding), input_name='cpe_name'), ))
3223 if self.xmlns_value is not None and 'xmlns_value' not in already_processed:
3224 already_processed.append('xmlns_value')
3225 outfile.write(' xmlns_value=%s' % (self.gds_format_string(quote_attrib(self.xmlns_value).encode(ExternalEncoding), input_name='xmlns_value'), ))
3226 - def exportChildren(self, outfile, level, namespace_='maec:', name_='CPESpecificationType', fromsubclass_=False):
3227 if self.Title is not None:
3228 self.Title.export(outfile, level, namespace_, name_='Title')
3229 if self.meta_item_metadata is not None:
3230 self.meta_item_metadata.export(outfile, level, namespace_, name_='meta-item-metadata')
3231 - def hasContent_(self):
3232 if (
3233 self.Title is not None or
3234 self.meta_item_metadata is not None
3235 ):
3236 return True
3237 else:
3238 return False
3239 - def exportLiteral(self, outfile, level, name_='CPESpecificationType'):
3245 if self.cpe_name is not None and 'cpe_name' not in already_processed:
3246 already_processed.append('cpe_name')
3247 showIndent(outfile, level)
3248 outfile.write('cpe_name = "%s",\n' % (self.cpe_name,))
3249 if self.xmlns_value is not None and 'xmlns_value' not in already_processed:
3250 already_processed.append('xmlns_value')
3251 showIndent(outfile, level)
3252 outfile.write('xmlns_value = "%s",\n' % (self.xmlns_value,))
3254 if self.Title is not None:
3255 showIndent(outfile, level)
3256 outfile.write('Title=model_.TitleType(\n')
3257 self.Title.exportLiteral(outfile, level, name_='Title')
3258 showIndent(outfile, level)
3259 outfile.write('),\n')
3260 if self.meta_item_metadata is not None:
3261 showIndent(outfile, level)
3262 outfile.write('meta_item_metadata=model_.meta_item_metadataType(\n')
3263 self.meta_item_metadata.exportLiteral(outfile, level, name_='meta_item_metadata')
3264 showIndent(outfile, level)
3265 outfile.write('),\n')
3272 value = find_attr_value_('cpe_name', node)
3273 if value is not None and 'cpe_name' not in already_processed:
3274 already_processed.append('cpe_name')
3275 self.cpe_name = value
3276 value = find_attr_value_('xmlns_value', node)
3277 if value is not None and 'xmlns_value' not in already_processed:
3278 already_processed.append('xmlns_value')
3279 self.xmlns_value = value
3280 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
3289
3290
3291
3293 """APICall_ParameterType is intended provide a method for the
3294 characterization of API calls, namely functions and their
3295 parameters.The apifunction_name attribute contains the exact
3296 name of the API function called. E.g. CreateFileW."""
3297 subclass = None
3298 superclass = None
3299 - def __init__(self, apifunction_name=None, id=None, Address=None, ReturnValue=None, APICall_Parameter=None):
3300 self.apifunction_name = _cast(None, apifunction_name)
3301 self.id = _cast(None, id)
3302 self.Address = Address
3303 self.ReturnValue = ReturnValue
3304 if APICall_Parameter is None:
3305 self.APICall_Parameter = []
3306 else:
3307 self.APICall_Parameter = APICall_Parameter
3313 factory = staticmethod(factory)
3315 - def set_Address(self, Address): self.Address = Address
3326 - def export(self, outfile, level, namespace_='maec:', name_='APICallType', namespacedef_=''):
3327 showIndent(outfile, level)
3328 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
3329 already_processed = []
3330 self.exportAttributes(outfile, level, already_processed, namespace_, name_='APICallType')
3331 if self.hasContent_():
3332 outfile.write('>\n')
3333 self.exportChildren(outfile, level + 1, namespace_, name_)
3334 showIndent(outfile, level)
3335 outfile.write('</%s%s>\n' % (namespace_, name_))
3336 else:
3337 outfile.write('/>\n')
3338 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='APICallType'):
3339 if self.apifunction_name is not None and 'apifunction_name' not in already_processed:
3340 already_processed.append('apifunction_name')
3341 outfile.write(' apifunction_name=%s' % (self.gds_format_string(quote_attrib(self.apifunction_name).encode(ExternalEncoding), input_name='apifunction_name'), ))
3342 if self.id is not None and 'id' not in already_processed:
3343 already_processed.append('id')
3344 outfile.write(' id=%s' % (quote_attrib(self.id), ))
3345 - def exportChildren(self, outfile, level, namespace_='maec:', name_='APICallType', fromsubclass_=False):
3346 if self.Address is not None:
3347 self.Address.export(outfile, level, namespace_, name_='Address')
3348 if self.ReturnValue is not None:
3349 showIndent(outfile, level)
3350 outfile.write('<%sReturnValue>%s</%sReturnValue>\n' % (namespace_, self.gds_format_string(quote_xml(self.ReturnValue).encode(ExternalEncoding), input_name='ReturnValue'), namespace_))
3351 for APICall_Parameter_ in self.APICall_Parameter:
3352 APICall_Parameter_.export(outfile, level, namespace_, name_='APICall_Parameter')
3353 - def hasContent_(self):
3354 if (
3355 self.Address is not None or
3356 self.ReturnValue is not None or
3357 self.APICall_Parameter
3358 ):
3359 return True
3360 else:
3361 return False
3368 if self.apifunction_name is not None and 'apifunction_name' not in already_processed:
3369 already_processed.append('apifunction_name')
3370 showIndent(outfile, level)
3371 outfile.write('apifunction_name = "%s",\n' % (self.apifunction_name,))
3372 if self.id is not None and 'id' not in already_processed:
3373 already_processed.append('id')
3374 showIndent(outfile, level)
3375 outfile.write('id = %s,\n' % (self.id,))
3377 if self.Address is not None:
3378 showIndent(outfile, level)
3379 outfile.write('Address=model_.xs_hexBinary(\n')
3380 self.Address.exportLiteral(outfile, level, name_='Address')
3381 showIndent(outfile, level)
3382 outfile.write('),\n')
3383 if self.ReturnValue is not None:
3384 showIndent(outfile, level)
3385 outfile.write('ReturnValue=%s,\n' % quote_python(self.ReturnValue).encode(ExternalEncoding))
3386 showIndent(outfile, level)
3387 outfile.write('APICall_Parameter=[\n')
3388 level += 1
3389 for APICall_Parameter_ in self.APICall_Parameter:
3390 showIndent(outfile, level)
3391 outfile.write('model_.APICall_ParameterType(\n')
3392 APICall_Parameter_.exportLiteral(outfile, level, name_='APICall_ParameterType')
3393 showIndent(outfile, level)
3394 outfile.write('),\n')
3395 level -= 1
3396 showIndent(outfile, level)
3397 outfile.write('],\n')
3404 value = find_attr_value_('apifunction_name', node)
3405 if value is not None and 'apifunction_name' not in already_processed:
3406 already_processed.append('apifunction_name')
3407 self.apifunction_name = value
3408 value = find_attr_value_('id', node)
3409 if value is not None and 'id' not in already_processed:
3410 already_processed.append('id')
3411 self.id = value
3412 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
3413 if nodeName_ == 'Address':
3414 obj_ = xs_hexBinary.factory()
3415 obj_.build(child_)
3416 self.set_Address(obj_)
3417 elif nodeName_ == 'ReturnValue':
3418 ReturnValue_ = child_.text
3419 ReturnValue_ = self.gds_validate_string(ReturnValue_, node, 'ReturnValue')
3420 self.ReturnValue = ReturnValue_
3421 elif nodeName_ == 'APICall_Parameter':
3422 obj_ = APICall_ParameterType.factory()
3423 obj_.build(child_)
3424 self.APICall_Parameter.append(obj_)
3425
3426
3427
3544
3545
3546
3548 """AnalysisType is intended to provide a way of characterizing typical
3549 malware analysis-related metadata, such as the subject of the
3550 analysis and when it was started.The analysis_method attribute
3551 is intended to provide a way of characterizing the type of
3552 analysis method used in the analysis element. Possible values:
3553 Static, Dynamic, Combinatorial, Other.The start_datetime
3554 attribute contains the date/time the analysis was started.The
3555 complete_datetime attribute contains the date/time the analysis
3556 was completed.The lastupdate_datetime attribute contains the
3557 date/time the analysis was last updated."""
3558 subclass = None
3559 superclass = None
3560 - def __init__(self, start_datetime=None, lastupdate_datetime=None, id=None, complete_datetime=None, analysis_method=None, Subject=None, Description=None, Analysts=None, Source=None, Analysis_Environment=None, Tools_Used=None, Notes=None):
3561 self.start_datetime = _cast(None, start_datetime)
3562 self.lastupdate_datetime = _cast(None, lastupdate_datetime)
3563 self.id = _cast(None, id)
3564 self.complete_datetime = _cast(None, complete_datetime)
3565 self.analysis_method = _cast(None, analysis_method)
3566 if Subject is None:
3567 self.Subject = []
3568 else:
3569 self.Subject = Subject
3570 self.Description = Description
3571 self.Analysts = Analysts
3572 self.Source = Source
3573 self.Analysis_Environment = Analysis_Environment
3574 self.Tools_Used = Tools_Used
3575 self.Notes = Notes
3581 factory = staticmethod(factory)
3583 - def set_Subject(self, Subject): self.Subject = Subject
3584 - def add_Subject(self, value): self.Subject.append(value)
3589 - def set_Analysts(self, Analysts): self.Analysts = Analysts
3591 - def set_Source(self, Source): self.Source = Source
3597 - def set_Notes(self, Notes): self.Notes = Notes
3608 - def export(self, outfile, level, namespace_='maec:', name_='AnalysisType', namespacedef_=''):
3609 showIndent(outfile, level)
3610 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
3611 already_processed = []
3612 self.exportAttributes(outfile, level, already_processed, namespace_, name_='AnalysisType')
3613 if self.hasContent_():
3614 outfile.write('>\n')
3615 self.exportChildren(outfile, level + 1, namespace_, name_)
3616 showIndent(outfile, level)
3617 outfile.write('</%s%s>\n' % (namespace_, name_))
3618 else:
3619 outfile.write('/>\n')
3620 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='AnalysisType'):
3621 if self.start_datetime is not None and 'start_datetime' not in already_processed:
3622 already_processed.append('start_datetime')
3623 outfile.write(' start_datetime=%s' % (self.gds_format_string(quote_attrib(self.start_datetime).encode(ExternalEncoding), input_name='start_datetime'), ))
3624 if self.lastupdate_datetime is not None and 'lastupdate_datetime' not in already_processed:
3625 already_processed.append('lastupdate_datetime')
3626 outfile.write(' lastupdate_datetime=%s' % (self.gds_format_string(quote_attrib(self.lastupdate_datetime).encode(ExternalEncoding), input_name='lastupdate_datetime'), ))
3627 if self.id is not None and 'id' not in already_processed:
3628 already_processed.append('id')
3629 outfile.write(' id=%s' % (quote_attrib(self.id), ))
3630 if self.complete_datetime is not None and 'complete_datetime' not in already_processed:
3631 already_processed.append('complete_datetime')
3632 outfile.write(' complete_datetime=%s' % (self.gds_format_string(quote_attrib(self.complete_datetime).encode(ExternalEncoding), input_name='complete_datetime'), ))
3633 if self.analysis_method is not None and 'analysis_method' not in already_processed:
3634 already_processed.append('analysis_method')
3635 outfile.write(' analysis_method=%s' % (self.gds_format_string(quote_attrib(self.analysis_method).encode(ExternalEncoding), input_name='analysis_method'), ))
3636 - def exportChildren(self, outfile, level, namespace_='maec:', name_='AnalysisType', fromsubclass_=False):
3637 for Subject_ in self.Subject:
3638 Subject_.export(outfile, level, namespace_, name_='Subject')
3639 if self.Description is not None:
3640 self.Description.export(outfile, level, namespace_, name_='Description')
3641 if self.Analysts is not None:
3642 self.Analysts.export(outfile, level, namespace_, name_='Analysts')
3643 if self.Source is not None:
3644 self.Source.export(outfile, level, namespace_, name_='Source')
3645 if self.Analysis_Environment is not None:
3646 self.Analysis_Environment.export(outfile, level, namespace_, name_='Analysis_Environment')
3647 if self.Tools_Used is not None:
3648 self.Tools_Used.export(outfile, level, namespace_, name_='Tools_Used')
3649 if self.Notes is not None:
3650 self.Notes.export(outfile, level, namespace_, name_='Notes')
3651 - def hasContent_(self):
3652 if (
3653 self.Subject or
3654 self.Description is not None or
3655 self.Analysts is not None or
3656 self.Source is not None or
3657 self.Analysis_Environment is not None or
3658 self.Tools_Used is not None or
3659 self.Notes is not None
3660 ):
3661 return True
3662 else:
3663 return False
3670 if self.start_datetime is not None and 'start_datetime' not in already_processed:
3671 already_processed.append('start_datetime')
3672 showIndent(outfile, level)
3673 outfile.write('start_datetime = "%s",\n' % (self.start_datetime,))
3674 if self.lastupdate_datetime is not None and 'lastupdate_datetime' not in already_processed:
3675 already_processed.append('lastupdate_datetime')
3676 showIndent(outfile, level)
3677 outfile.write('lastupdate_datetime = "%s",\n' % (self.lastupdate_datetime,))
3678 if self.id is not None and 'id' not in already_processed:
3679 already_processed.append('id')
3680 showIndent(outfile, level)
3681 outfile.write('id = %s,\n' % (self.id,))
3682 if self.complete_datetime is not None and 'complete_datetime' not in already_processed:
3683 already_processed.append('complete_datetime')
3684 showIndent(outfile, level)
3685 outfile.write('complete_datetime = "%s",\n' % (self.complete_datetime,))
3686 if self.analysis_method is not None and 'analysis_method' not in already_processed:
3687 already_processed.append('analysis_method')
3688 showIndent(outfile, level)
3689 outfile.write('analysis_method = "%s",\n' % (self.analysis_method,))
3691 showIndent(outfile, level)
3692 outfile.write('Subject=[\n')
3693 level += 1
3694 for Subject_ in self.Subject:
3695 showIndent(outfile, level)
3696 outfile.write('model_.SubjectType(\n')
3697 Subject_.exportLiteral(outfile, level, name_='SubjectType')
3698 showIndent(outfile, level)
3699 outfile.write('),\n')
3700 level -= 1
3701 showIndent(outfile, level)
3702 outfile.write('],\n')
3703 if self.Description is not None:
3704 showIndent(outfile, level)
3705 outfile.write('Description=model_.StructuredTextType(\n')
3706 self.Description.exportLiteral(outfile, level, name_='Description')
3707 showIndent(outfile, level)
3708 outfile.write('),\n')
3709 if self.Analysts is not None:
3710 showIndent(outfile, level)
3711 outfile.write('Analysts=model_.AnalystsType(\n')
3712 self.Analysts.exportLiteral(outfile, level, name_='Analysts')
3713 showIndent(outfile, level)
3714 outfile.write('),\n')
3715 if self.Source is not None:
3716 showIndent(outfile, level)
3717 outfile.write('Source=model_.SourceType(\n')
3718 self.Source.exportLiteral(outfile, level, name_='Source')
3719 showIndent(outfile, level)
3720 outfile.write('),\n')
3721 if self.Analysis_Environment is not None:
3722 showIndent(outfile, level)
3723 outfile.write('Analysis_Environment=model_.Analysis_EnvironmentType(\n')
3724 self.Analysis_Environment.exportLiteral(outfile, level, name_='Analysis_Environment')
3725 showIndent(outfile, level)
3726 outfile.write('),\n')
3727 if self.Tools_Used is not None:
3728 showIndent(outfile, level)
3729 outfile.write('Tools_Used=model_.Tools_UsedType(\n')
3730 self.Tools_Used.exportLiteral(outfile, level, name_='Tools_Used')
3731 showIndent(outfile, level)
3732 outfile.write('),\n')
3733 if self.Notes is not None:
3734 showIndent(outfile, level)
3735 outfile.write('Notes=model_.NotesType(\n')
3736 self.Notes.exportLiteral(outfile, level, name_='Notes')
3737 showIndent(outfile, level)
3738 outfile.write('),\n')
3745 value = find_attr_value_('start_datetime', node)
3746 if value is not None and 'start_datetime' not in already_processed:
3747 already_processed.append('start_datetime')
3748 self.start_datetime = value
3749 value = find_attr_value_('lastupdate_datetime', node)
3750 if value is not None and 'lastupdate_datetime' not in already_processed:
3751 already_processed.append('lastupdate_datetime')
3752 self.lastupdate_datetime = value
3753 value = find_attr_value_('id', node)
3754 if value is not None and 'id' not in already_processed:
3755 already_processed.append('id')
3756 self.id = value
3757 value = find_attr_value_('complete_datetime', node)
3758 if value is not None and 'complete_datetime' not in already_processed:
3759 already_processed.append('complete_datetime')
3760 self.complete_datetime = value
3761 value = find_attr_value_('analysis_method', node)
3762 if value is not None and 'analysis_method' not in already_processed:
3763 already_processed.append('analysis_method')
3764 self.analysis_method = value
3765 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
3794
3795
3796
3798 """ObjectReferenceType is intended to serve as a method for linking to
3799 objects.The object_id attribute refers to the ID of the object
3800 being referenced.This attribute refers to the type of object
3801 entity being referenced. Possible values: Object, Object
3802 Collection."""
3803 subclass = None
3804 superclass = None
3805 - def __init__(self, type_=None, object_id=None):
3806 self.type_ = _cast(None, type_)
3807 self.object_id = _cast(None, object_id)
3808 pass
3814 factory = staticmethod(factory)
3816 - def set_type(self, type_): self.type_ = type_
3819 - def export(self, outfile, level, namespace_='maec:', name_='ObjectReferenceType', namespacedef_=''):
3820 showIndent(outfile, level)
3821 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
3822 already_processed = []
3823 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ObjectReferenceType')
3824 if self.hasContent_():
3825 outfile.write('>\n')
3826 self.exportChildren(outfile, level + 1, namespace_, name_)
3827 outfile.write('</%s%s>\n' % (namespace_, name_))
3828 else:
3829 outfile.write('/>\n')
3830 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ObjectReferenceType'):
3831 if self.type_ is not None and 'type_' not in already_processed:
3832 already_processed.append('type_')
3833 outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))
3834 if self.object_id is not None and 'object_id' not in already_processed:
3835 already_processed.append('object_id')
3836 outfile.write(' object_id=%s' % (quote_attrib(self.object_id), ))
3837 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ObjectReferenceType', fromsubclass_=False):
3839 - def hasContent_(self):
3840 if (
3841
3842 ):
3843 return True
3844 else:
3845 return False
3846 - def exportLiteral(self, outfile, level, name_='ObjectReferenceType'):
3852 if self.type_ is not None and 'type_' not in already_processed:
3853 already_processed.append('type_')
3854 showIndent(outfile, level)
3855 outfile.write('type_ = "%s",\n' % (self.type_,))
3856 if self.object_id is not None and 'object_id' not in already_processed:
3857 already_processed.append('object_id')
3858 showIndent(outfile, level)
3859 outfile.write('object_id = %s,\n' % (self.object_id,))
3868 value = find_attr_value_('type', node)
3869 if value is not None and 'type' not in already_processed:
3870 already_processed.append('type')
3871 self.type_ = value
3872 value = find_attr_value_('object_id', node)
3873 if value is not None and 'object_id' not in already_processed:
3874 already_processed.append('object_id')
3875 self.object_id = value
3876 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
3878
3879
3880
3882 """CVEVulnerabilityType is intended to provide a way of referencing
3883 specific vulnerabilities that malware exploits or attempts to
3884 exploit via a Common Vulnerabilities and Exposures (CPE)
3885 identifier. For more information on CPE please see
3886 http://cpe.mitre.org. The cve_id attribute contains the ID of
3887 the CVE that is being referenced. E.g. CVE-1999-0002."""
3888 subclass = None
3889 superclass = None
3890 - def __init__(self, cve_id=None, CVE_Description=None):
3891 self.cve_id = _cast(None, cve_id)
3892 self.CVE_Description = CVE_Description
3898 factory = staticmethod(factory)
3902 - def set_cve_id(self, cve_id): self.cve_id = cve_id
3903 - def export(self, outfile, level, namespace_='maec:', name_='CVEVulnerabilityType', namespacedef_=''):
3904 showIndent(outfile, level)
3905 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
3906 already_processed = []
3907 self.exportAttributes(outfile, level, already_processed, namespace_, name_='CVEVulnerabilityType')
3908 if self.hasContent_():
3909 outfile.write('>\n')
3910 self.exportChildren(outfile, level + 1, namespace_, name_)
3911 showIndent(outfile, level)
3912 outfile.write('</%s%s>\n' % (namespace_, name_))
3913 else:
3914 outfile.write('/>\n')
3915 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='CVEVulnerabilityType'):
3916 if self.cve_id is not None and 'cve_id' not in already_processed:
3917 already_processed.append('cve_id')
3918 outfile.write(' cve_id=%s' % (self.gds_format_string(quote_attrib(self.cve_id).encode(ExternalEncoding), input_name='cve_id'), ))
3919 - def exportChildren(self, outfile, level, namespace_='maec:', name_='CVEVulnerabilityType', fromsubclass_=False):
3920 if self.CVE_Description is not None:
3921 showIndent(outfile, level)
3922 outfile.write('<%sCVE_Description>%s</%sCVE_Description>\n' % (namespace_, self.gds_format_string(quote_xml(self.CVE_Description).encode(ExternalEncoding), input_name='CVE_Description'), namespace_))
3923 - def hasContent_(self):
3924 if (
3925 self.CVE_Description is not None
3926 ):
3927 return True
3928 else:
3929 return False
3930 - def exportLiteral(self, outfile, level, name_='CVEVulnerabilityType'):
3936 if self.cve_id is not None and 'cve_id' not in already_processed:
3937 already_processed.append('cve_id')
3938 showIndent(outfile, level)
3939 outfile.write('cve_id = "%s",\n' % (self.cve_id,))
3950 value = find_attr_value_('cve_id', node)
3951 if value is not None and 'cve_id' not in already_processed:
3952 already_processed.append('cve_id')
3953 self.cve_id = value
3954 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
3955 if nodeName_ == 'CVE_Description':
3956 CVE_Description_ = child_.text
3957 CVE_Description_ = self.gds_validate_string(CVE_Description_, node, 'CVE_Description')
3958 self.CVE_Description = CVE_Description_
3959
3960
3961
3963 """ObjectCollectionType is intended to provide a mechanism for
3964 characterizing collections of effects. For instance, it can be
3965 used to group all of the actions that are associated with a
3966 specific behavior.The name attribute contains the name of the
3967 object collection, if applicable."""
3968 subclass = None
3969 superclass = None
3970 - def __init__(self, id=None, name=None, Affinity_Type=None, Affinity_Degree=None, Object_Sub_Collection=None, Object=None, Object_Reference=None):
3971 self.id = _cast(None, id)
3972 self.name = _cast(None, name)
3973 self.Affinity_Type = Affinity_Type
3974 self.Affinity_Degree = Affinity_Degree
3975 if Object_Sub_Collection is None:
3976 self.Object_Sub_Collection = []
3977 else:
3978 self.Object_Sub_Collection = Object_Sub_Collection
3979 if Object is None:
3980 self.Object = []
3981 else:
3982 self.Object = Object
3983 if Object_Reference is None:
3984 self.Object_Reference = []
3985 else:
3986 self.Object_Reference = Object_Reference
3992 factory = staticmethod(factory)
4002 - def set_Object(self, Object): self.Object = Object
4003 - def add_Object(self, value): self.Object.append(value)
4004 - def insert_Object(self, index, value): self.Object[index] = value
4013 - def export(self, outfile, level, namespace_='maec:', name_='ObjectCollectionType', namespacedef_=''):
4014 showIndent(outfile, level)
4015 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
4016 already_processed = []
4017 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ObjectCollectionType')
4018 if self.hasContent_():
4019 outfile.write('>\n')
4020 self.exportChildren(outfile, level + 1, namespace_, name_)
4021 showIndent(outfile, level)
4022 outfile.write('</%s%s>\n' % (namespace_, name_))
4023 else:
4024 outfile.write('/>\n')
4025 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ObjectCollectionType'):
4026 if self.id is not None and 'id' not in already_processed:
4027 already_processed.append('id')
4028 outfile.write(' id=%s' % (quote_attrib(self.id), ))
4029 if self.name is not None and 'name' not in already_processed:
4030 already_processed.append('name')
4031 outfile.write(' name=%s' % (self.gds_format_string(quote_attrib(self.name).encode(ExternalEncoding), input_name='name'), ))
4032 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ObjectCollectionType', fromsubclass_=False):
4033 if self.Affinity_Type is not None:
4034 showIndent(outfile, level)
4035 outfile.write('<%sAffinity_Type>%s</%sAffinity_Type>\n' % (namespace_, self.gds_format_string(quote_xml(self.Affinity_Type).encode(ExternalEncoding), input_name='Affinity_Type'), namespace_))
4036 if self.Affinity_Degree is not None:
4037 showIndent(outfile, level)
4038 outfile.write('<%sAffinity_Degree>%s</%sAffinity_Degree>\n' % (namespace_, self.gds_format_string(quote_xml(self.Affinity_Degree).encode(ExternalEncoding), input_name='Affinity_Degree'), namespace_))
4039 for Object_Sub_Collection_ in self.Object_Sub_Collection:
4040 Object_Sub_Collection_.export(outfile, level, namespace_, name_='Object_Sub_Collection')
4041 for Object_ in self.Object:
4042 Object_.export(outfile, level, namespace_, name_='Object')
4043 for Object_Reference_ in self.Object_Reference:
4044 Object_Reference_.export(outfile, level, namespace_, name_='Object_Reference')
4045 - def hasContent_(self):
4046 if (
4047 self.Affinity_Type is not None or
4048 self.Affinity_Degree is not None or
4049 self.Object_Sub_Collection or
4050 self.Object or
4051 self.Object_Reference
4052 ):
4053 return True
4054 else:
4055 return False
4056 - def exportLiteral(self, outfile, level, name_='ObjectCollectionType'):
4062 if self.id is not None and 'id' not in already_processed:
4063 already_processed.append('id')
4064 showIndent(outfile, level)
4065 outfile.write('id = %s,\n' % (self.id,))
4066 if self.name is not None and 'name' not in already_processed:
4067 already_processed.append('name')
4068 showIndent(outfile, level)
4069 outfile.write('name = "%s",\n' % (self.name,))
4071 if self.Affinity_Type is not None:
4072 showIndent(outfile, level)
4073 outfile.write('Affinity_Type=%s,\n' % quote_python(self.Affinity_Type).encode(ExternalEncoding))
4074 if self.Affinity_Degree is not None:
4075 showIndent(outfile, level)
4076 outfile.write('Affinity_Degree=%s,\n' % quote_python(self.Affinity_Degree).encode(ExternalEncoding))
4077 showIndent(outfile, level)
4078 outfile.write('Object_Sub_Collection=[\n')
4079 level += 1
4080 for Object_Sub_Collection_ in self.Object_Sub_Collection:
4081 showIndent(outfile, level)
4082 outfile.write('model_.ObjectCollectionType(\n')
4083 Object_Sub_Collection_.exportLiteral(outfile, level, name_='ObjectCollectionType')
4084 showIndent(outfile, level)
4085 outfile.write('),\n')
4086 level -= 1
4087 showIndent(outfile, level)
4088 outfile.write('],\n')
4089 showIndent(outfile, level)
4090 outfile.write('Object=[\n')
4091 level += 1
4092 for Object_ in self.Object:
4093 showIndent(outfile, level)
4094 outfile.write('model_.ObjectType(\n')
4095 Object_.exportLiteral(outfile, level, name_='ObjectType')
4096 showIndent(outfile, level)
4097 outfile.write('),\n')
4098 level -= 1
4099 showIndent(outfile, level)
4100 outfile.write('],\n')
4101 showIndent(outfile, level)
4102 outfile.write('Object_Reference=[\n')
4103 level += 1
4104 for Object_Reference_ in self.Object_Reference:
4105 showIndent(outfile, level)
4106 outfile.write('model_.ObjectReferenceType(\n')
4107 Object_Reference_.exportLiteral(outfile, level, name_='ObjectReferenceType')
4108 showIndent(outfile, level)
4109 outfile.write('),\n')
4110 level -= 1
4111 showIndent(outfile, level)
4112 outfile.write('],\n')
4119 value = find_attr_value_('id', node)
4120 if value is not None and 'id' not in already_processed:
4121 already_processed.append('id')
4122 self.id = value
4123 value = find_attr_value_('name', node)
4124 if value is not None and 'name' not in already_processed:
4125 already_processed.append('name')
4126 self.name = value
4127 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
4128 if nodeName_ == 'Affinity_Type':
4129 Affinity_Type_ = child_.text
4130 Affinity_Type_ = self.gds_validate_string(Affinity_Type_, node, 'Affinity_Type')
4131 self.Affinity_Type = Affinity_Type_
4132 elif nodeName_ == 'Affinity_Degree':
4133 Affinity_Degree_ = child_.text
4134 Affinity_Degree_ = self.gds_validate_string(Affinity_Degree_, node, 'Affinity_Degree')
4135 self.Affinity_Degree = Affinity_Degree_
4136 elif nodeName_ == 'Object_Sub_Collection':
4137 obj_ = ObjectCollectionType.factory()
4138 obj_.build(child_)
4139 self.Object_Sub_Collection.append(obj_)
4140 elif nodeName_ == 'Object':
4141 obj_ = ObjectType.factory()
4142 obj_.build(child_)
4143 self.Object.append(obj_)
4144 elif nodeName_ == 'Object_Reference':
4145 obj_ = ObjectReferenceType.factory()
4146 obj_.build(child_)
4147 self.Object_Reference.append(obj_)
4148
4149
4150
4152 """DataType is intended to provide a relatively abstract way of
4153 characterizing data segments that may be
4154 written/read/transmitted or otherwise utilized in actions or
4155 behaviors. The format attribute refers to the type of data
4156 contained in this element. Possible values: Binary, Hexadecimal,
4157 Text, Other."""
4158 subclass = None
4159 superclass = None
4160 - def __init__(self, id=None, format=None, Data_Size=None, Discovery_Method=None, Data_Segment=None):
4161 self.id = _cast(None, id)
4162 self.format = _cast(None, format)
4163 self.Data_Size = Data_Size
4164 self.Discovery_Method = Discovery_Method
4165 self.Data_Segment = Data_Segment
4171 factory = staticmethod(factory)
4182 - def export(self, outfile, level, namespace_='maec:', name_='DataType', namespacedef_=''):
4183 showIndent(outfile, level)
4184 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
4185 already_processed = []
4186 self.exportAttributes(outfile, level, already_processed, namespace_, name_='DataType')
4187 if self.hasContent_():
4188 outfile.write('>\n')
4189 self.exportChildren(outfile, level + 1, namespace_, name_)
4190 showIndent(outfile, level)
4191 outfile.write('</%s%s>\n' % (namespace_, name_))
4192 else:
4193 outfile.write('/>\n')
4194 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='DataType'):
4195 if self.id is not None and 'id' not in already_processed:
4196 already_processed.append('id')
4197 outfile.write(' id=%s' % (quote_attrib(self.id), ))
4198 if self.format is not None and 'format' not in already_processed:
4199 already_processed.append('format')
4200 outfile.write(' format=%s' % (self.gds_format_string(quote_attrib(self.format).encode(ExternalEncoding), input_name='format'), ))
4201 - def exportChildren(self, outfile, level, namespace_='maec:', name_='DataType', fromsubclass_=False):
4202 if self.Data_Size is not None:
4203 self.Data_Size.export(outfile, level, namespace_, name_='Data_Size', )
4204 if self.Discovery_Method is not None:
4205 self.Discovery_Method.export(outfile, level, namespace_, name_='Discovery_Method')
4206 if self.Data_Segment is not None:
4207 showIndent(outfile, level)
4208 outfile.write('<%sData_Segment>%s</%sData_Segment>\n' % (namespace_, self.gds_format_string(quote_xml(self.Data_Segment).encode(ExternalEncoding), input_name='Data_Segment'), namespace_))
4209 - def hasContent_(self):
4210 if (
4211 self.Data_Size is not None or
4212 self.Discovery_Method is not None or
4213 self.Data_Segment is not None
4214 ):
4215 return True
4216 else:
4217 return False
4224 if self.id is not None and 'id' not in already_processed:
4225 already_processed.append('id')
4226 showIndent(outfile, level)
4227 outfile.write('id = %s,\n' % (self.id,))
4228 if self.format is not None and 'format' not in already_processed:
4229 already_processed.append('format')
4230 showIndent(outfile, level)
4231 outfile.write('format = "%s",\n' % (self.format,))
4233 if self.Data_Size is not None:
4234 showIndent(outfile, level)
4235 outfile.write('Data_Size=model_.Data_SizeType(\n')
4236 self.Data_Size.exportLiteral(outfile, level, name_='Data_Size')
4237 showIndent(outfile, level)
4238 outfile.write('),\n')
4239 if self.Discovery_Method is not None:
4240 showIndent(outfile, level)
4241 outfile.write('Discovery_Method=model_.DiscoveryMethod(\n')
4242 self.Discovery_Method.exportLiteral(outfile, level, name_='Discovery_Method')
4243 showIndent(outfile, level)
4244 outfile.write('),\n')
4245 if self.Data_Segment is not None:
4246 showIndent(outfile, level)
4247 outfile.write('Data_Segment=%s,\n' % quote_python(self.Data_Segment).encode(ExternalEncoding))
4254 value = find_attr_value_('id', node)
4255 if value is not None and 'id' not in already_processed:
4256 already_processed.append('id')
4257 self.id = value
4258 value = find_attr_value_('format', node)
4259 if value is not None and 'format' not in already_processed:
4260 already_processed.append('format')
4261 self.format = value
4262 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
4275
4276
4277
4279 """CodeType is intended to provide a way of characterizing segments of
4280 malicious code that is extracted or otherwise retrieved from
4281 malware.The codetype attribute is intended to provide a way of
4282 specifying the type of code being characterized. Possible
4283 values: Exploit_Code, Shellcode, Unknown, Other.The language
4284 attribute refers to the programming language used in the code
4285 characterized in this element. Possible values are: C, C++, C#,
4286 Java, JSP, Javascript, ASP.NET, SQL, Python, Perl, PHP, SOAP,
4287 Ruby, Shell, Pseudocode, .NET, Assembly, XML, HTML.If the code
4288 was discovered inside a binary, the start_address attribute can
4289 be used to reference the its start address.The processor_family
4290 attribute is intended to specify the class of processor that the
4291 code snippet is targeting. Possible values: x86-32, x86-64,
4292 IA-64, PowerPC, ARM, Alpha, SPARC, z/Architecture, eSi-RISC,
4293 MIPS, Motorola 68k, Other.The xorpattern attribute contains a 16
4294 -hexadecimal-character hex string, which represents the pattern
4295 that the Code_Segment element should be XORed with in order to
4296 recover the actual code. The default value is 55AA55AA55AA55BB,
4297 as specified by IETF RFC 5901."""
4298 subclass = None
4299 superclass = None
4300 - def __init__(self, language=None, processor_family=None, start_address=None, codetype=None, xorpattern='55AA55AA55AA55BB', id=None, Discovery_Method=None, Code_Segment=None, Code_Segment_XOR=None, External_File=None):
4301 self.language = _cast(None, language)
4302 self.processor_family = _cast(None, processor_family)
4303 self.start_address = _cast(None, start_address)
4304 self.codetype = _cast(None, codetype)
4305 self.xorpattern = _cast(None, xorpattern)
4306 self.id = _cast(None, id)
4307 self.Discovery_Method = Discovery_Method
4308 self.Code_Segment = Code_Segment
4309 self.Code_Segment_XOR = Code_Segment_XOR
4310 self.External_File = External_File
4316 factory = staticmethod(factory)
4326 - def set_language(self, language): self.language = language
4332 - def set_codetype(self, codetype): self.codetype = codetype
4337 - def export(self, outfile, level, namespace_='maec:', name_='CodeType', namespacedef_=''):
4338 showIndent(outfile, level)
4339 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
4340 already_processed = []
4341 self.exportAttributes(outfile, level, already_processed, namespace_, name_='CodeType')
4342 if self.hasContent_():
4343 outfile.write('>\n')
4344 self.exportChildren(outfile, level + 1, namespace_, name_)
4345 showIndent(outfile, level)
4346 outfile.write('</%s%s>\n' % (namespace_, name_))
4347 else:
4348 outfile.write('/>\n')
4349 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='CodeType'):
4350 if self.language is not None and 'language' not in already_processed:
4351 already_processed.append('language')
4352 outfile.write(' language=%s' % (quote_attrib(self.language), ))
4353 if self.processor_family is not None and 'processor_family' not in already_processed:
4354 already_processed.append('processor_family')
4355 outfile.write(' processor_family=%s' % (quote_attrib(self.processor_family), ))
4356 if self.start_address is not None and 'start_address' not in already_processed:
4357 already_processed.append('start_address')
4358 outfile.write(' start_address=%s' % (quote_attrib(self.start_address), ))
4359 if self.codetype is not None and 'codetype' not in already_processed:
4360 already_processed.append('codetype')
4361 outfile.write(' codetype=%s' % (self.gds_format_string(quote_attrib(self.codetype).encode(ExternalEncoding), input_name='codetype'), ))
4362 if self.xorpattern is not None and 'xorpattern' not in already_processed:
4363 already_processed.append('xorpattern')
4364 outfile.write(' xorpattern=%s' % (quote_attrib(self.xorpattern), ))
4365 if self.id is not None and 'id' not in already_processed:
4366 already_processed.append('id')
4367 outfile.write(' id=%s' % (quote_attrib(self.id), ))
4368 - def exportChildren(self, outfile, level, namespace_='maec:', name_='CodeType', fromsubclass_=False):
4369 if self.Discovery_Method is not None:
4370 self.Discovery_Method.export(outfile, level, namespace_, name_='Discovery_Method')
4371 if self.Code_Segment is not None:
4372 showIndent(outfile, level)
4373 outfile.write('<%sCode_Segment>%s</%sCode_Segment>\n' % (namespace_, self.gds_format_string(quote_xml(self.Code_Segment).encode(ExternalEncoding), input_name='Code_Segment'), namespace_))
4374 if self.Code_Segment_XOR is not None:
4375 self.Code_Segment_XOR.export(outfile, level, namespace_, name_='Code_Segment_XOR')
4376 if self.External_File is not None:
4377 self.External_File.export(outfile, level, namespace_, name_='External_File')
4378 - def hasContent_(self):
4379 if (
4380 self.Discovery_Method is not None or
4381 self.Code_Segment is not None or
4382 self.Code_Segment_XOR is not None or
4383 self.External_File is not None
4384 ):
4385 return True
4386 else:
4387 return False
4394 if self.language is not None and 'language' not in already_processed:
4395 already_processed.append('language')
4396 showIndent(outfile, level)
4397 outfile.write('language = %s,\n' % (self.language,))
4398 if self.processor_family is not None and 'processor_family' not in already_processed:
4399 already_processed.append('processor_family')
4400 showIndent(outfile, level)
4401 outfile.write('processor_family = %s,\n' % (self.processor_family,))
4402 if self.start_address is not None and 'start_address' not in already_processed:
4403 already_processed.append('start_address')
4404 showIndent(outfile, level)
4405 outfile.write('start_address = %s,\n' % (self.start_address,))
4406 if self.codetype is not None and 'codetype' not in already_processed:
4407 already_processed.append('codetype')
4408 showIndent(outfile, level)
4409 outfile.write('codetype = "%s",\n' % (self.codetype,))
4410 if self.xorpattern is not None and 'xorpattern' not in already_processed:
4411 already_processed.append('xorpattern')
4412 showIndent(outfile, level)
4413 outfile.write('xorpattern = %s,\n' % (self.xorpattern,))
4414 if self.id is not None and 'id' not in already_processed:
4415 already_processed.append('id')
4416 showIndent(outfile, level)
4417 outfile.write('id = %s,\n' % (self.id,))
4419 if self.Discovery_Method is not None:
4420 showIndent(outfile, level)
4421 outfile.write('Discovery_Method=model_.DiscoveryMethod(\n')
4422 self.Discovery_Method.exportLiteral(outfile, level, name_='Discovery_Method')
4423 showIndent(outfile, level)
4424 outfile.write('),\n')
4425 if self.Code_Segment is not None:
4426 showIndent(outfile, level)
4427 outfile.write('Code_Segment=%s,\n' % quote_python(self.Code_Segment).encode(ExternalEncoding))
4428 if self.Code_Segment_XOR is not None:
4429 showIndent(outfile, level)
4430 outfile.write('Code_Segment_XOR=model_.xs_hexBinary(\n')
4431 self.Code_Segment_XOR.exportLiteral(outfile, level, name_='Code_Segment_XOR')
4432 showIndent(outfile, level)
4433 outfile.write('),\n')
4434 if self.External_File is not None:
4435 showIndent(outfile, level)
4436 outfile.write('External_File=model_.ObjectType(\n')
4437 self.External_File.exportLiteral(outfile, level, name_='External_File')
4438 showIndent(outfile, level)
4439 outfile.write('),\n')
4446 value = find_attr_value_('language', node)
4447 if value is not None and 'language' not in already_processed:
4448 already_processed.append('language')
4449 self.language = value
4450 value = find_attr_value_('processor_family', node)
4451 if value is not None and 'processor_family' not in already_processed:
4452 already_processed.append('processor_family')
4453 self.processor_family = value
4454 value = find_attr_value_('start_address', node)
4455 if value is not None and 'start_address' not in already_processed:
4456 already_processed.append('start_address')
4457 self.start_address = value
4458 value = find_attr_value_('codetype', node)
4459 if value is not None and 'codetype' not in already_processed:
4460 already_processed.append('codetype')
4461 self.codetype = value
4462 value = find_attr_value_('xorpattern', node)
4463 if value is not None and 'xorpattern' not in already_processed:
4464 already_processed.append('xorpattern')
4465 self.xorpattern = value
4466 value = find_attr_value_('id', node)
4467 if value is not None and 'id' not in already_processed:
4468 already_processed.append('id')
4469 self.id = value
4470 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
4487
4488
4489
4491 """DiscoveryMethod is intended to provide a mechanism for the
4492 characterization of how actions, behaviors, malicious code, data
4493 segments, and other relevant MAEC entities were discovered.The
4494 tool_id attribute contains the id of the tool used to discovery
4495 the entity (if applicable).The method attribute contains the
4496 method used to discover the entity. Possible values are: Static
4497 Analysis, Dynamic/Runtime Analysis, Other."""
4498 subclass = None
4499 superclass = None
4500 - def __init__(self, tool_id=None, method=None):
4501 self.tool_id = _cast(None, tool_id)
4502 self.method = _cast(None, method)
4503 pass
4509 factory = staticmethod(factory)
4513 - def set_method(self, method): self.method = method
4514 - def export(self, outfile, level, namespace_='maec:', name_='DiscoveryMethod', namespacedef_=''):
4515 showIndent(outfile, level)
4516 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
4517 already_processed = []
4518 self.exportAttributes(outfile, level, already_processed, namespace_, name_='DiscoveryMethod')
4519 if self.hasContent_():
4520 outfile.write('>\n')
4521 self.exportChildren(outfile, level + 1, namespace_, name_)
4522 outfile.write('</%s%s>\n' % (namespace_, name_))
4523 else:
4524 outfile.write('/>\n')
4525 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='DiscoveryMethod'):
4526 if self.tool_id is not None and 'tool_id' not in already_processed:
4527 already_processed.append('tool_id')
4528 outfile.write(' tool_id=%s' % (quote_attrib(self.tool_id), ))
4529 if self.method is not None and 'method' not in already_processed:
4530 already_processed.append('method')
4531 outfile.write(' method=%s' % (self.gds_format_string(quote_attrib(self.method).encode(ExternalEncoding), input_name='method'), ))
4532 - def exportChildren(self, outfile, level, namespace_='maec:', name_='DiscoveryMethod', fromsubclass_=False):
4534 - def hasContent_(self):
4535 if (
4536
4537 ):
4538 return True
4539 else:
4540 return False
4541 - def exportLiteral(self, outfile, level, name_='DiscoveryMethod'):
4547 if self.tool_id is not None and 'tool_id' not in already_processed:
4548 already_processed.append('tool_id')
4549 showIndent(outfile, level)
4550 outfile.write('tool_id = %s,\n' % (self.tool_id,))
4551 if self.method is not None and 'method' not in already_processed:
4552 already_processed.append('method')
4553 showIndent(outfile, level)
4554 outfile.write('method = "%s",\n' % (self.method,))
4563 value = find_attr_value_('tool_id', node)
4564 if value is not None and 'tool_id' not in already_processed:
4565 already_processed.append('tool_id')
4566 self.tool_id = value
4567 value = find_attr_value_('method', node)
4568 if value is not None and 'method' not in already_processed:
4569 already_processed.append('method')
4570 self.method = value
4571 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
4573
4574
4575
4577 """HashType is intended as a way of chracterizing the outputs of
4578 crytopgrahic hash functions.The type attribute refers to the
4579 type of hash used in the Hash_Value element. Possible choices
4580 are: SHA1, SHA256, MD5, MD6, Other.The other_type refers to an
4581 optional attribute, which can be used if it is necessary to
4582 specify a hash type other than those that are enumerated in the
4583 'type' attribute."""
4584 subclass = None
4585 superclass = None
4586 - def __init__(self, type_=None, other_type=None, Hash_Value=None):
4587 self.type_ = _cast(None, type_)
4588 self.other_type = _cast(None, other_type)
4589 self.Hash_Value = Hash_Value
4595 factory = staticmethod(factory)
4599 - def set_type(self, type_): self.type_ = type_
4602 - def export(self, outfile, level, namespace_='maec:', name_='HashType', namespacedef_=''):
4603 showIndent(outfile, level)
4604 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
4605 already_processed = []
4606 self.exportAttributes(outfile, level, already_processed, namespace_, name_='HashType')
4607 if self.hasContent_():
4608 outfile.write('>\n')
4609 self.exportChildren(outfile, level + 1, namespace_, name_)
4610 showIndent(outfile, level)
4611 outfile.write('</%s%s>\n' % (namespace_, name_))
4612 else:
4613 outfile.write('/>\n')
4614 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='HashType'):
4615 if self.type_ is not None and 'type_' not in already_processed:
4616 already_processed.append('type_')
4617 outfile.write(' type=%s' % (quote_attrib(self.type_), ))
4618 if self.other_type is not None and 'other_type' not in already_processed:
4619 already_processed.append('other_type')
4620 outfile.write(' other_type=%s' % (self.gds_format_string(quote_attrib(self.other_type).encode(ExternalEncoding), input_name='other_type'), ))
4621 - def exportChildren(self, outfile, level, namespace_='maec:', name_='HashType', fromsubclass_=False):
4625 - def hasContent_(self):
4626 if (
4627 self.Hash_Value is not None
4628 ):
4629 return True
4630 else:
4631 return False
4638 if self.type_ is not None and 'type_' not in already_processed:
4639 already_processed.append('type_')
4640 showIndent(outfile, level)
4641 outfile.write('type_ = %s,\n' % (self.type_,))
4642 if self.other_type is not None and 'other_type' not in already_processed:
4643 already_processed.append('other_type')
4644 showIndent(outfile, level)
4645 outfile.write('other_type = "%s",\n' % (self.other_type,))
4647 if self.Hash_Value is not None:
4648 showIndent(outfile, level)
4649 outfile.write('Hash_Value=model_.xs_hexBinary(\n')
4650 self.Hash_Value.exportLiteral(outfile, level, name_='Hash_Value')
4651 showIndent(outfile, level)
4652 outfile.write('),\n')
4659 value = find_attr_value_('type', node)
4660 if value is not None and 'type' not in already_processed:
4661 already_processed.append('type')
4662 self.type_ = value
4663 value = find_attr_value_('other_type', node)
4664 if value is not None and 'other_type' not in already_processed:
4665 already_processed.append('other_type')
4666 self.other_type = value
4667 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
4672
4673
4674
4676 """PEDataDirectoryStruct is intended as container for the attributes
4677 present in a PE binary's data directory structure."""
4678 subclass = None
4679 superclass = None
4680 - def __init__(self, Virtual_Address=None, Size=None):
4681 self.Virtual_Address = Virtual_Address
4682 self.Size = Size
4688 factory = staticmethod(factory)
4692 - def set_Size(self, Size): self.Size = Size
4693 - def export(self, outfile, level, namespace_='maec:', name_='PEDataDirectoryStruct', namespacedef_=''):
4694 showIndent(outfile, level)
4695 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
4696 already_processed = []
4697 self.exportAttributes(outfile, level, already_processed, namespace_, name_='PEDataDirectoryStruct')
4698 if self.hasContent_():
4699 outfile.write('>\n')
4700 self.exportChildren(outfile, level + 1, namespace_, name_)
4701 showIndent(outfile, level)
4702 outfile.write('</%s%s>\n' % (namespace_, name_))
4703 else:
4704 outfile.write('/>\n')
4705 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='PEDataDirectoryStruct'):
4707 - def exportChildren(self, outfile, level, namespace_='maec:', name_='PEDataDirectoryStruct', fromsubclass_=False):
4708 if self.Virtual_Address is not None:
4709 self.Virtual_Address.export(outfile, level, namespace_, name_='Virtual_Address', )
4710 if self.Size is not None:
4711 showIndent(outfile, level)
4712 outfile.write('<%sSize>%s</%sSize>\n' % (namespace_, self.gds_format_integer(self.Size, input_name='Size'), namespace_))
4713 - def hasContent_(self):
4714 if (
4715 self.Virtual_Address is not None or
4716 self.Size is not None
4717 ):
4718 return True
4719 else:
4720 return False
4721 - def exportLiteral(self, outfile, level, name_='PEDataDirectoryStruct'):
4729 if self.Virtual_Address is not None:
4730 showIndent(outfile, level)
4731 outfile.write('Virtual_Address=model_.xs_hexBinary(\n')
4732 self.Virtual_Address.exportLiteral(outfile, level, name_='Virtual_Address')
4733 showIndent(outfile, level)
4734 outfile.write('),\n')
4735 if self.Size is not None:
4736 showIndent(outfile, level)
4737 outfile.write('Size=%d,\n' % self.Size)
4745 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
4746 if nodeName_ == 'Virtual_Address':
4747 obj_ = xs_hexBinary.factory()
4748 obj_.build(child_)
4749 self.set_Virtual_Address(obj_)
4750 elif nodeName_ == 'Size':
4751 sval_ = child_.text
4752 try:
4753 ival_ = int(sval_)
4754 except (TypeError, ValueError) as e:
4755 raise_parse_error(child_, 'requires integer: %s' % e)
4756 ival_ = self.gds_validate_integer(ival_, node, 'Size')
4757 self.Size = ival_
4758
4759
4760
4762 """PESectionHeaderStruct is intended as container for the attributes
4763 present in a PE binary's section header structure."""
4764 subclass = None
4765 superclass = None
4767 self.Hashes = Hashes
4768 self.Name = Name
4769 self.Physical_Address = Physical_Address
4770 self.Virtual_Address = Virtual_Address
4771 self.Size_Of_Raw_Data = Size_Of_Raw_Data
4772 self.Pointer_To_Raw_Data = Pointer_To_Raw_Data
4773 self.Pointer_To_Relocations = Pointer_To_Relocations
4774 self.Pointer_To_Linenumbers = Pointer_To_Linenumbers
4775 self.Number_Of_Relocations = Number_Of_Relocations
4776 self.Number_Of_Linenumbers = Number_Of_Linenumbers
4777 self.Characteristics = Characteristics
4783 factory = staticmethod(factory)
4807 showIndent(outfile, level)
4808 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
4809 already_processed = []
4810 self.exportAttributes(outfile, level, already_processed, namespace_, name_='PESectionHeaderStruct')
4811 if self.hasContent_():
4812 outfile.write('>\n')
4813 self.exportChildren(outfile, level + 1, namespace_, name_)
4814 showIndent(outfile, level)
4815 outfile.write('</%s%s>\n' % (namespace_, name_))
4816 else:
4817 outfile.write('/>\n')
4821 if self.Hashes is not None:
4822 self.Hashes.export(outfile, level, namespace_, name_='Hashes')
4823 if self.Name is not None:
4824 showIndent(outfile, level)
4825 outfile.write('<%sName>%s</%sName>\n' % (namespace_, self.gds_format_string(quote_xml(self.Name).encode(ExternalEncoding), input_name='Name'), namespace_))
4826 if self.Physical_Address is not None:
4827 self.Physical_Address.export(outfile, level, namespace_, name_='Physical_Address')
4828 if self.Virtual_Address is not None:
4829 self.Virtual_Address.export(outfile, level, namespace_, name_='Virtual_Address')
4830 if self.Size_Of_Raw_Data is not None:
4831 self.Size_Of_Raw_Data.export(outfile, level, namespace_, name_='Size_Of_Raw_Data')
4832 if self.Pointer_To_Raw_Data is not None:
4833 self.Pointer_To_Raw_Data.export(outfile, level, namespace_, name_='Pointer_To_Raw_Data')
4834 if self.Pointer_To_Relocations is not None:
4835 self.Pointer_To_Relocations.export(outfile, level, namespace_, name_='Pointer_To_Relocations')
4836 if self.Pointer_To_Linenumbers is not None:
4837 self.Pointer_To_Linenumbers.export(outfile, level, namespace_, name_='Pointer_To_Linenumbers')
4838 if self.Number_Of_Relocations is not None:
4839 showIndent(outfile, level)
4840 outfile.write('<%sNumber_Of_Relocations>%s</%sNumber_Of_Relocations>\n' % (namespace_, self.gds_format_integer(self.Number_Of_Relocations, input_name='Number_Of_Relocations'), namespace_))
4841 if self.Number_Of_Linenumbers is not None:
4842 showIndent(outfile, level)
4843 outfile.write('<%sNumber_Of_Linenumbers>%s</%sNumber_Of_Linenumbers>\n' % (namespace_, self.gds_format_integer(self.Number_Of_Linenumbers, input_name='Number_Of_Linenumbers'), namespace_))
4844 if self.Characteristics is not None:
4845 self.Characteristics.export(outfile, level, namespace_, name_='Characteristics')
4847 if (
4848 self.Hashes is not None or
4849 self.Name is not None or
4850 self.Physical_Address is not None or
4851 self.Virtual_Address is not None or
4852 self.Size_Of_Raw_Data is not None or
4853 self.Pointer_To_Raw_Data is not None or
4854 self.Pointer_To_Relocations is not None or
4855 self.Pointer_To_Linenumbers is not None or
4856 self.Number_Of_Relocations is not None or
4857 self.Number_Of_Linenumbers is not None or
4858 self.Characteristics is not None
4859 ):
4860 return True
4861 else:
4862 return False
4871 if self.Hashes is not None:
4872 showIndent(outfile, level)
4873 outfile.write('Hashes=model_.HashesType5(\n')
4874 self.Hashes.exportLiteral(outfile, level, name_='Hashes')
4875 showIndent(outfile, level)
4876 outfile.write('),\n')
4877 if self.Name is not None:
4878 showIndent(outfile, level)
4879 outfile.write('Name=%s,\n' % quote_python(self.Name).encode(ExternalEncoding))
4880 if self.Physical_Address is not None:
4881 showIndent(outfile, level)
4882 outfile.write('Physical_Address=model_.xs_hexBinary(\n')
4883 self.Physical_Address.exportLiteral(outfile, level, name_='Physical_Address')
4884 showIndent(outfile, level)
4885 outfile.write('),\n')
4886 if self.Virtual_Address is not None:
4887 showIndent(outfile, level)
4888 outfile.write('Virtual_Address=model_.xs_hexBinary(\n')
4889 self.Virtual_Address.exportLiteral(outfile, level, name_='Virtual_Address')
4890 showIndent(outfile, level)
4891 outfile.write('),\n')
4892 if self.Size_Of_Raw_Data is not None:
4893 showIndent(outfile, level)
4894 outfile.write('Size_Of_Raw_Data=model_.xs_hexBinary(\n')
4895 self.Size_Of_Raw_Data.exportLiteral(outfile, level, name_='Size_Of_Raw_Data')
4896 showIndent(outfile, level)
4897 outfile.write('),\n')
4898 if self.Pointer_To_Raw_Data is not None:
4899 showIndent(outfile, level)
4900 outfile.write('Pointer_To_Raw_Data=model_.xs_hexBinary(\n')
4901 self.Pointer_To_Raw_Data.exportLiteral(outfile, level, name_='Pointer_To_Raw_Data')
4902 showIndent(outfile, level)
4903 outfile.write('),\n')
4904 if self.Pointer_To_Relocations is not None:
4905 showIndent(outfile, level)
4906 outfile.write('Pointer_To_Relocations=model_.xs_hexBinary(\n')
4907 self.Pointer_To_Relocations.exportLiteral(outfile, level, name_='Pointer_To_Relocations')
4908 showIndent(outfile, level)
4909 outfile.write('),\n')
4910 if self.Pointer_To_Linenumbers is not None:
4911 showIndent(outfile, level)
4912 outfile.write('Pointer_To_Linenumbers=model_.xs_hexBinary(\n')
4913 self.Pointer_To_Linenumbers.exportLiteral(outfile, level, name_='Pointer_To_Linenumbers')
4914 showIndent(outfile, level)
4915 outfile.write('),\n')
4916 if self.Number_Of_Relocations is not None:
4917 showIndent(outfile, level)
4918 outfile.write('Number_Of_Relocations=%d,\n' % self.Number_Of_Relocations)
4919 if self.Number_Of_Linenumbers is not None:
4920 showIndent(outfile, level)
4921 outfile.write('Number_Of_Linenumbers=%d,\n' % self.Number_Of_Linenumbers)
4922 if self.Characteristics is not None:
4923 showIndent(outfile, level)
4924 outfile.write('Characteristics=model_.xs_hexBinary(\n')
4925 self.Characteristics.exportLiteral(outfile, level, name_='Characteristics')
4926 showIndent(outfile, level)
4927 outfile.write('),\n')
4936 if nodeName_ == 'Hashes':
4937 obj_ = HashesType5.factory()
4938 obj_.build(child_)
4939 self.set_Hashes(obj_)
4940 elif nodeName_ == 'Name':
4941 Name_ = child_.text
4942 Name_ = self.gds_validate_string(Name_, node, 'Name')
4943 self.Name = Name_
4944 elif nodeName_ == 'Physical_Address':
4945 obj_ = xs_hexBinary.factory()
4946 obj_.build(child_)
4947 self.set_Physical_Address(obj_)
4948 elif nodeName_ == 'Virtual_Address':
4949 obj_ = xs_hexBinary.factory()
4950 obj_.build(child_)
4951 self.set_Virtual_Address(obj_)
4952 elif nodeName_ == 'Size_Of_Raw_Data':
4953 obj_ = xs_hexBinary.factory()
4954 obj_.build(child_)
4955 self.set_Size_Of_Raw_Data(obj_)
4956 elif nodeName_ == 'Pointer_To_Raw_Data':
4957 obj_ = xs_hexBinary.factory()
4958 obj_.build(child_)
4959 self.set_Pointer_To_Raw_Data(obj_)
4960 elif nodeName_ == 'Pointer_To_Relocations':
4961 obj_ = xs_hexBinary.factory()
4962 obj_.build(child_)
4963 self.set_Pointer_To_Relocations(obj_)
4964 elif nodeName_ == 'Pointer_To_Linenumbers':
4965 obj_ = xs_hexBinary.factory()
4966 obj_.build(child_)
4967 self.set_Pointer_To_Linenumbers(obj_)
4968 elif nodeName_ == 'Number_Of_Relocations':
4969 sval_ = child_.text
4970 try:
4971 ival_ = int(sval_)
4972 except (TypeError, ValueError) as e:
4973 raise_parse_error(child_, 'requires integer: %s' % e)
4974 ival_ = self.gds_validate_integer(ival_, node, 'Number_Of_Relocations')
4975 self.Number_Of_Relocations = ival_
4976 elif nodeName_ == 'Number_Of_Linenumbers':
4977 sval_ = child_.text
4978 try:
4979 ival_ = int(sval_)
4980 except (TypeError, ValueError) as e:
4981 raise_parse_error(child_, 'requires integer: %s' % e)
4982 ival_ = self.gds_validate_integer(ival_, node, 'Number_Of_Linenumbers')
4983 self.Number_Of_Linenumbers = ival_
4984 elif nodeName_ == 'Characteristics':
4985 obj_ = xs_hexBinary.factory()
4986 obj_.build(child_)
4987 self.set_Characteristics(obj_)
4988
4989
4990
4992 """PEStringType is intended as container for strings extracted from PE
4993 binaries.The address attribute refers to the location of the
4994 specified string in the PE binary.The encoding attribute refers
4995 to the encoding method used for the string extracted from the PE
4996 binary. Possible values are: ANSI, Unicode, Other.The length
4997 attribute refers to the length, in characters, of the string
4998 extracted from the PE binary."""
4999 subclass = None
5000 superclass = None
5001 - def __init__(self, length=None, encoding=None, address=None, String_Value=None, Hashes=None):
5002 self.length = _cast(int, length)
5003 self.encoding = _cast(None, encoding)
5004 self.address = _cast(None, address)
5005 self.String_Value = String_Value
5006 self.Hashes = Hashes
5012 factory = staticmethod(factory)
5016 - def set_Hashes(self, Hashes): self.Hashes = Hashes
5018 - def set_length(self, length): self.length = length
5020 - def set_encoding(self, encoding): self.encoding = encoding
5022 - def set_address(self, address): self.address = address
5023 - def export(self, outfile, level, namespace_='maec:', name_='PEStringType', namespacedef_=''):
5024 showIndent(outfile, level)
5025 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
5026 already_processed = []
5027 self.exportAttributes(outfile, level, already_processed, namespace_, name_='PEStringType')
5028 if self.hasContent_():
5029 outfile.write('>\n')
5030 self.exportChildren(outfile, level + 1, namespace_, name_)
5031 showIndent(outfile, level)
5032 outfile.write('</%s%s>\n' % (namespace_, name_))
5033 else:
5034 outfile.write('/>\n')
5035 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='PEStringType'):
5036 if self.length is not None and 'length' not in already_processed:
5037 already_processed.append('length')
5038 outfile.write(' length="%s"' % self.gds_format_integer(self.length, input_name='length'))
5039 if self.encoding is not None and 'encoding' not in already_processed:
5040 already_processed.append('encoding')
5041 outfile.write(' encoding=%s' % (self.gds_format_string(quote_attrib(self.encoding).encode(ExternalEncoding), input_name='encoding'), ))
5042 if self.address is not None and 'address' not in already_processed:
5043 already_processed.append('address')
5044 outfile.write(' address=%s' % (quote_attrib(self.address), ))
5045 - def exportChildren(self, outfile, level, namespace_='maec:', name_='PEStringType', fromsubclass_=False):
5046 if self.String_Value is not None:
5047 showIndent(outfile, level)
5048 outfile.write('<%sString_Value>%s</%sString_Value>\n' % (namespace_, self.gds_format_string(quote_xml(self.String_Value).encode(ExternalEncoding), input_name='String_Value'), namespace_))
5049 if self.Hashes is not None:
5050 self.Hashes.export(outfile, level, namespace_, name_='Hashes')
5051 - def hasContent_(self):
5052 if (
5053 self.String_Value is not None or
5054 self.Hashes is not None
5055 ):
5056 return True
5057 else:
5058 return False
5065 if self.length is not None and 'length' not in already_processed:
5066 already_processed.append('length')
5067 showIndent(outfile, level)
5068 outfile.write('length = %d,\n' % (self.length,))
5069 if self.encoding is not None and 'encoding' not in already_processed:
5070 already_processed.append('encoding')
5071 showIndent(outfile, level)
5072 outfile.write('encoding = "%s",\n' % (self.encoding,))
5073 if self.address is not None and 'address' not in already_processed:
5074 already_processed.append('address')
5075 showIndent(outfile, level)
5076 outfile.write('address = %s,\n' % (self.address,))
5078 if self.String_Value is not None:
5079 showIndent(outfile, level)
5080 outfile.write('String_Value=%s,\n' % quote_python(self.String_Value).encode(ExternalEncoding))
5081 if self.Hashes is not None:
5082 showIndent(outfile, level)
5083 outfile.write('Hashes=model_.HashesType6(\n')
5084 self.Hashes.exportLiteral(outfile, level, name_='Hashes')
5085 showIndent(outfile, level)
5086 outfile.write('),\n')
5093 value = find_attr_value_('length', node)
5094 if value is not None and 'length' not in already_processed:
5095 already_processed.append('length')
5096 try:
5097 self.length = int(value)
5098 except ValueError as e:
5099 raise_parse_error(node, 'Bad integer attribute: %s' % e)
5100 value = find_attr_value_('encoding', node)
5101 if value is not None and 'encoding' not in already_processed:
5102 already_processed.append('encoding')
5103 self.encoding = value
5104 value = find_attr_value_('address', node)
5105 if value is not None and 'address' not in already_processed:
5106 already_processed.append('address')
5107 self.address = value
5108 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
5109 if nodeName_ == 'String_Value':
5110 String_Value_ = child_.text
5111 String_Value_ = self.gds_validate_string(String_Value_, node, 'String_Value')
5112 self.String_Value = String_Value_
5113 elif nodeName_ == 'Hashes':
5114 obj_ = HashesType6.factory()
5115 obj_.build(child_)
5116 self.set_Hashes(obj_)
5117
5118
5119
5121 """PEImportType is intended as container for the attributes relevant to
5122 PE binary imports.The type attribute refers to the type of
5123 import, with regards to being initially visible or hidden in
5124 relation to PE binary packing. A packed binary will typically
5125 have few initially visible imports, and thus it is necessary to
5126 make the distinction between those that are visible initially or
5127 only after the binary is unpacked. Thus, the possible values for
5128 this attribute are: Initially Visible, Initially Hidden.The
5129 delay_load attribute is a boolean value that is intended to
5130 describe whether a PE binary import is delay-load or not."""
5131 subclass = None
5132 superclass = None
5133 - def __init__(self, type_=None, delay_load=None, File_Name=None, Virtual_Address=None, Imported_Functions=None):
5134 self.type_ = _cast(None, type_)
5135 self.delay_load = _cast(bool, delay_load)
5136 self.File_Name = File_Name
5137 self.Virtual_Address = Virtual_Address
5138 self.Imported_Functions = Imported_Functions
5144 factory = staticmethod(factory)
5152 - def set_type(self, type_): self.type_ = type_
5155 - def export(self, outfile, level, namespace_='maec:', name_='PEImportType', namespacedef_=''):
5156 showIndent(outfile, level)
5157 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
5158 already_processed = []
5159 self.exportAttributes(outfile, level, already_processed, namespace_, name_='PEImportType')
5160 if self.hasContent_():
5161 outfile.write('>\n')
5162 self.exportChildren(outfile, level + 1, namespace_, name_)
5163 showIndent(outfile, level)
5164 outfile.write('</%s%s>\n' % (namespace_, name_))
5165 else:
5166 outfile.write('/>\n')
5167 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='PEImportType'):
5168 if self.type_ is not None and 'type_' not in already_processed:
5169 already_processed.append('type_')
5170 outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))
5171 if self.delay_load is not None and 'delay_load' not in already_processed:
5172 already_processed.append('delay_load')
5173 outfile.write(' delay_load="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.delay_load)), input_name='delay_load'))
5174 - def exportChildren(self, outfile, level, namespace_='maec:', name_='PEImportType', fromsubclass_=False):
5175 if self.File_Name is not None:
5176 showIndent(outfile, level)
5177 outfile.write('<%sFile_Name>%s</%sFile_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.File_Name).encode(ExternalEncoding), input_name='File_Name'), namespace_))
5178 if self.Virtual_Address is not None:
5179 self.Virtual_Address.export(outfile, level, namespace_, name_='Virtual_Address')
5180 if self.Imported_Functions is not None:
5181 self.Imported_Functions.export(outfile, level, namespace_, name_='Imported_Functions')
5182 - def hasContent_(self):
5183 if (
5184 self.File_Name is not None or
5185 self.Virtual_Address is not None or
5186 self.Imported_Functions is not None
5187 ):
5188 return True
5189 else:
5190 return False
5197 if self.type_ is not None and 'type_' not in already_processed:
5198 already_processed.append('type_')
5199 showIndent(outfile, level)
5200 outfile.write('type_ = "%s",\n' % (self.type_,))
5201 if self.delay_load is not None and 'delay_load' not in already_processed:
5202 already_processed.append('delay_load')
5203 showIndent(outfile, level)
5204 outfile.write('delay_load = %s,\n' % (self.delay_load,))
5206 if self.File_Name is not None:
5207 showIndent(outfile, level)
5208 outfile.write('File_Name=%s,\n' % quote_python(self.File_Name).encode(ExternalEncoding))
5209 if self.Virtual_Address is not None:
5210 showIndent(outfile, level)
5211 outfile.write('Virtual_Address=model_.xs_hexBinary(\n')
5212 self.Virtual_Address.exportLiteral(outfile, level, name_='Virtual_Address')
5213 showIndent(outfile, level)
5214 outfile.write('),\n')
5215 if self.Imported_Functions is not None:
5216 showIndent(outfile, level)
5217 outfile.write('Imported_Functions=model_.Imported_FunctionsType(\n')
5218 self.Imported_Functions.exportLiteral(outfile, level, name_='Imported_Functions')
5219 showIndent(outfile, level)
5220 outfile.write('),\n')
5227 value = find_attr_value_('type', node)
5228 if value is not None and 'type' not in already_processed:
5229 already_processed.append('type')
5230 self.type_ = value
5231 value = find_attr_value_('delay_load', node)
5232 if value is not None and 'delay_load' not in already_processed:
5233 already_processed.append('delay_load')
5234 if value in ('true', '1'):
5235 self.delay_load = True
5236 elif value in ('false', '0'):
5237 self.delay_load = False
5238 else:
5239 raise_parse_error(node, 'Bad boolean attribute')
5240 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
5253
5254
5255
5257 """PEExportType is intended as container for the attributes relevant to
5258 PE binary exports."""
5259 subclass = None
5260 superclass = None
5261 - def __init__(self, Function_Name=None, Entry_Point=None, Ordinal=None):
5262 self.Function_Name = Function_Name
5263 self.Entry_Point = Entry_Point
5264 self.Ordinal = Ordinal
5270 factory = staticmethod(factory)
5273 - def get_Entry_Point(self): return self.Entry_Point
5274 - def set_Entry_Point(self, Entry_Point): self.Entry_Point = Entry_Point
5276 - def set_Ordinal(self, Ordinal): self.Ordinal = Ordinal
5277 - def export(self, outfile, level, namespace_='maec:', name_='PEExportType', namespacedef_=''):
5278 showIndent(outfile, level)
5279 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
5280 already_processed = []
5281 self.exportAttributes(outfile, level, already_processed, namespace_, name_='PEExportType')
5282 if self.hasContent_():
5283 outfile.write('>\n')
5284 self.exportChildren(outfile, level + 1, namespace_, name_)
5285 showIndent(outfile, level)
5286 outfile.write('</%s%s>\n' % (namespace_, name_))
5287 else:
5288 outfile.write('/>\n')
5289 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='PEExportType'):
5291 - def exportChildren(self, outfile, level, namespace_='maec:', name_='PEExportType', fromsubclass_=False):
5292 if self.Function_Name is not None:
5293 showIndent(outfile, level)
5294 outfile.write('<%sFunction_Name>%s</%sFunction_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.Function_Name).encode(ExternalEncoding), input_name='Function_Name'), namespace_))
5295 if self.Entry_Point is not None:
5296 showIndent(outfile, level)
5297 outfile.write('<%sEntry_Point>%s</%sEntry_Point>\n' % (namespace_, self.gds_format_string(quote_xml(self.Entry_Point).encode(ExternalEncoding), input_name='Entry_Point'), namespace_))
5298 if self.Ordinal is not None:
5299 showIndent(outfile, level)
5300 outfile.write('<%sOrdinal>%s</%sOrdinal>\n' % (namespace_, self.gds_format_integer(self.Ordinal, input_name='Ordinal'), namespace_))
5301 - def hasContent_(self):
5302 if (
5303 self.Function_Name is not None or
5304 self.Entry_Point is not None or
5305 self.Ordinal is not None
5306 ):
5307 return True
5308 else:
5309 return False
5318 if self.Function_Name is not None:
5319 showIndent(outfile, level)
5320 outfile.write('Function_Name=%s,\n' % quote_python(self.Function_Name).encode(ExternalEncoding))
5321 if self.Entry_Point is not None:
5322 showIndent(outfile, level)
5323 outfile.write('Entry_Point=model_.xs_hexBinary(\n')
5324 self.Entry_Point.exportLiteral(outfile, level, name_='Entry_Point')
5325 showIndent(outfile, level)
5326 outfile.write('),\n')
5327 if self.Ordinal is not None:
5328 showIndent(outfile, level)
5329 outfile.write('Ordinal=%d,\n' % self.Ordinal)
5337 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
5338 if nodeName_ == 'Function_Name':
5339 Function_Name_ = child_.text
5340 Function_Name_ = self.gds_validate_string(Function_Name_, node, 'Function_Name')
5341 self.Function_Name = Function_Name_
5342 elif nodeName_ == 'Entry_Point':
5343 obj_ = xs_hexBinary.factory()
5344 obj_.build(child_)
5345 self.set_Entry_Point(obj_)
5346 elif nodeName_ == 'Ordinal':
5347 sval_ = child_.text
5348 try:
5349 ival_ = int(sval_)
5350 except (TypeError, ValueError) as e:
5351 raise_parse_error(child_, 'requires integer: %s' % e)
5352 ival_ = self.gds_validate_integer(ival_, node, 'Ordinal')
5353 self.Ordinal = ival_
5354
5355
5356
5358 """PESectionType is intended as container for the attributes relevant
5359 to PE binary sections."""
5360 subclass = None
5361 superclass = None
5362 - def __init__(self, Header_Hashes=None, Data_Hashes=None, Section_Name=None, Entropy=None, Virtual_Address=None, Virtual_Size=None, Flags=None, Relocations=None):
5363 self.Header_Hashes = Header_Hashes
5364 self.Data_Hashes = Data_Hashes
5365 self.Section_Name = Section_Name
5366 self.Entropy = Entropy
5367 self.Virtual_Address = Virtual_Address
5368 self.Virtual_Size = Virtual_Size
5369 self.Flags = Flags
5370 self.Relocations = Relocations
5376 factory = staticmethod(factory)
5384 - def set_Entropy(self, Entropy): self.Entropy = Entropy
5390 - def set_Flags(self, Flags): self.Flags = Flags
5393 - def export(self, outfile, level, namespace_='maec:', name_='PESectionType', namespacedef_=''):
5394 showIndent(outfile, level)
5395 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
5396 already_processed = []
5397 self.exportAttributes(outfile, level, already_processed, namespace_, name_='PESectionType')
5398 if self.hasContent_():
5399 outfile.write('>\n')
5400 self.exportChildren(outfile, level + 1, namespace_, name_)
5401 showIndent(outfile, level)
5402 outfile.write('</%s%s>\n' % (namespace_, name_))
5403 else:
5404 outfile.write('/>\n')
5405 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='PESectionType'):
5407 - def exportChildren(self, outfile, level, namespace_='maec:', name_='PESectionType', fromsubclass_=False):
5408 if self.Header_Hashes is not None:
5409 self.Header_Hashes.export(outfile, level, namespace_, name_='Header_Hashes')
5410 if self.Data_Hashes is not None:
5411 self.Data_Hashes.export(outfile, level, namespace_, name_='Data_Hashes')
5412 if self.Section_Name is not None:
5413 showIndent(outfile, level)
5414 outfile.write('<%sSection_Name>%s</%sSection_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.Section_Name).encode(ExternalEncoding), input_name='Section_Name'), namespace_))
5415 if self.Entropy is not None:
5416 showIndent(outfile, level)
5417 outfile.write('<%sEntropy>%s</%sEntropy>\n' % (namespace_, self.gds_format_float(self.Entropy, input_name='Entropy'), namespace_))
5418 if self.Virtual_Address is not None:
5419 showIndent(outfile, level)
5420 outfile.write('<%sVirtual_Address>%s</%sVirtual_Address>\n' % (namespace_, self.gds_format_string(quote_xml(self.Virtual_Address).encode(ExternalEncoding), input_name='Virtual_Address'), namespace_))
5421 if self.Virtual_Size is not None:
5422 showIndent(outfile, level)
5423 outfile.write('<%sVirtual_Size>%s</%sVirtual_Size>\n' % (namespace_, self.gds_format_integer(self.Virtual_Size, input_name='Virtual_Size'), namespace_))
5424 if self.Flags is not None:
5425 self.Flags.export(outfile, level, namespace_, name_='Flags')
5426 if self.Relocations is not None:
5427 showIndent(outfile, level)
5428 outfile.write('<%sRelocations>%s</%sRelocations>\n' % (namespace_, self.gds_format_integer(self.Relocations, input_name='Relocations'), namespace_))
5429 - def hasContent_(self):
5430 if (
5431 self.Header_Hashes is not None or
5432 self.Data_Hashes is not None or
5433 self.Section_Name is not None or
5434 self.Entropy is not None or
5435 self.Virtual_Address is not None or
5436 self.Virtual_Size is not None or
5437 self.Flags is not None or
5438 self.Relocations is not None
5439 ):
5440 return True
5441 else:
5442 return False
5443 - def exportLiteral(self, outfile, level, name_='PESectionType'):
5451 if self.Header_Hashes is not None:
5452 showIndent(outfile, level)
5453 outfile.write('Header_Hashes=model_.Header_HashesType(\n')
5454 self.Header_Hashes.exportLiteral(outfile, level, name_='Header_Hashes')
5455 showIndent(outfile, level)
5456 outfile.write('),\n')
5457 if self.Data_Hashes is not None:
5458 showIndent(outfile, level)
5459 outfile.write('Data_Hashes=model_.Data_HashesType(\n')
5460 self.Data_Hashes.exportLiteral(outfile, level, name_='Data_Hashes')
5461 showIndent(outfile, level)
5462 outfile.write('),\n')
5463 if self.Section_Name is not None:
5464 showIndent(outfile, level)
5465 outfile.write('Section_Name=%s,\n' % quote_python(self.Section_Name).encode(ExternalEncoding))
5466 if self.Entropy is not None:
5467 showIndent(outfile, level)
5468 outfile.write('Entropy=%f,\n' % self.Entropy)
5469 if self.Virtual_Address is not None:
5470 showIndent(outfile, level)
5471 outfile.write('Virtual_Address=model_.xs_hexBinary(\n')
5472 self.Virtual_Address.exportLiteral(outfile, level, name_='Virtual_Address')
5473 showIndent(outfile, level)
5474 outfile.write('),\n')
5475 if self.Virtual_Size is not None:
5476 showIndent(outfile, level)
5477 outfile.write('Virtual_Size=%d,\n' % self.Virtual_Size)
5478 if self.Flags is not None:
5479 showIndent(outfile, level)
5480 outfile.write('Flags=model_.xs_hexBinary(\n')
5481 self.Flags.exportLiteral(outfile, level, name_='Flags')
5482 showIndent(outfile, level)
5483 outfile.write('),\n')
5484 if self.Relocations is not None:
5485 showIndent(outfile, level)
5486 outfile.write('Relocations=%d,\n' % self.Relocations)
5494 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
5495 if nodeName_ == 'Header_Hashes':
5496 obj_ = Header_HashesType.factory()
5497 obj_.build(child_)
5498 self.set_Header_Hashes(obj_)
5499 elif nodeName_ == 'Data_Hashes':
5500 obj_ = Data_HashesType.factory()
5501 obj_.build(child_)
5502 self.set_Data_Hashes(obj_)
5503 elif nodeName_ == 'Section_Name':
5504 Section_Name_ = child_.text
5505 Section_Name_ = self.gds_validate_string(Section_Name_, node, 'Section_Name')
5506 self.Section_Name = Section_Name_
5507 elif nodeName_ == 'Entropy':
5508 sval_ = child_.text
5509 try:
5510 fval_ = float(sval_)
5511 except (TypeError, ValueError) as e:
5512 raise_parse_error(child_, 'requires float or double: %s' % e)
5513 fval_ = self.gds_validate_float(fval_, node, 'Entropy')
5514 self.Entropy = fval_
5515 elif nodeName_ == 'Virtual_Address':
5516 obj_ = xs_hexBinary.factory()
5517 obj_.build(child_)
5518 self.set_Virtual_Address(obj_)
5519 elif nodeName_ == 'Virtual_Size':
5520 sval_ = child_.text
5521 try:
5522 ival_ = int(sval_)
5523 except (TypeError, ValueError) as e:
5524 raise_parse_error(child_, 'requires integer: %s' % e)
5525 ival_ = self.gds_validate_integer(ival_, node, 'Virtual_Size')
5526 self.Virtual_Size = ival_
5527 elif nodeName_ == 'Flags':
5528 obj_ = xs_hexBinary.factory()
5529 obj_.build(child_)
5530 self.set_Flags(obj_)
5531 elif nodeName_ == 'Relocations':
5532 sval_ = child_.text
5533 try:
5534 ival_ = int(sval_)
5535 except (TypeError, ValueError) as e:
5536 raise_parse_error(child_, 'requires integer: %s' % e)
5537 ival_ = self.gds_validate_integer(ival_, node, 'Relocations')
5538 self.Relocations = ival_
5539
5540
5541
5543 """PEResourceType is intended as container for the attributes relevant
5544 to PE binary resources.The type attribute refers to the type of
5545 data referred to by this resource. Possible values are: Cursor,
5546 Bitmap, Icon, Menu, Dialog, String, Fontdir, Font, Accelerator,
5547 RCData, MessageTable, GroupCursor, GroupIcon, Version,
5548 DLGInclude, PlugPlay, Vxd, AniCursor, AniIcon, HTML, Manifest,
5549 Other."""
5550 subclass = None
5551 superclass = None
5552 - def __init__(self, type_=None, Name=None, Hashes=None):
5553 self.type_ = _cast(None, type_)
5554 self.Name = Name
5555 self.Hashes = Hashes
5561 factory = staticmethod(factory)
5563 - def set_Name(self, Name): self.Name = Name
5565 - def set_Hashes(self, Hashes): self.Hashes = Hashes
5567 - def set_type(self, type_): self.type_ = type_
5568 - def export(self, outfile, level, namespace_='maec:', name_='PEResourceType', namespacedef_=''):
5569 showIndent(outfile, level)
5570 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
5571 already_processed = []
5572 self.exportAttributes(outfile, level, already_processed, namespace_, name_='PEResourceType')
5573 if self.hasContent_():
5574 outfile.write('>\n')
5575 self.exportChildren(outfile, level + 1, namespace_, name_)
5576 showIndent(outfile, level)
5577 outfile.write('</%s%s>\n' % (namespace_, name_))
5578 else:
5579 outfile.write('/>\n')
5580 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='PEResourceType'):
5581 if self.type_ is not None and 'type_' not in already_processed:
5582 already_processed.append('type_')
5583 outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))
5584 - def exportChildren(self, outfile, level, namespace_='maec:', name_='PEResourceType', fromsubclass_=False):
5585 if self.Name is not None:
5586 showIndent(outfile, level)
5587 outfile.write('<%sName>%s</%sName>\n' % (namespace_, self.gds_format_string(quote_xml(self.Name).encode(ExternalEncoding), input_name='Name'), namespace_))
5588 if self.Hashes is not None:
5589 self.Hashes.export(outfile, level, namespace_, name_='Hashes')
5590 - def hasContent_(self):
5591 if (
5592 self.Name is not None or
5593 self.Hashes is not None
5594 ):
5595 return True
5596 else:
5597 return False
5598 - def exportLiteral(self, outfile, level, name_='PEResourceType'):
5604 if self.type_ is not None and 'type_' not in already_processed:
5605 already_processed.append('type_')
5606 showIndent(outfile, level)
5607 outfile.write('type_ = "%s",\n' % (self.type_,))
5609 if self.Name is not None:
5610 showIndent(outfile, level)
5611 outfile.write('Name=%s,\n' % quote_python(self.Name).encode(ExternalEncoding))
5612 if self.Hashes is not None:
5613 showIndent(outfile, level)
5614 outfile.write('Hashes=model_.HashesType7(\n')
5615 self.Hashes.exportLiteral(outfile, level, name_='Hashes')
5616 showIndent(outfile, level)
5617 outfile.write('),\n')
5624 value = find_attr_value_('type', node)
5625 if value is not None and 'type' not in already_processed:
5626 already_processed.append('type')
5627 self.type_ = value
5628 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
5637
5638
5639
5911
5912
5913
5915 """Object definition for files. The required attribute is the id, which
5916 needs to be globally unique. By convention, the value used is a
5917 hash, the stronger the better. The choice should be: use sha256
5918 if you have it, if not use sha1, if not use md5. Other hashes
5919 and file sizes are recorded in the elements. File names are put
5920 in as properties."""
5921 subclass = None
5922 superclass = None
5923 - def __init__(self, id=None, md5=None, sha1=None, sha256=None, sha512=None, size=None, crc32=None, fileType=None, extraHash=None):
5924 self.id = _cast(None, id)
5925 self.md5 = md5
5926 self.sha1 = sha1
5927 self.sha256 = sha256
5928 self.sha512 = sha512
5929 self.size = size
5930 self.crc32 = crc32
5931 if fileType is None:
5932 self.fileType = []
5933 else:
5934 self.fileType = fileType
5935 if extraHash is None:
5936 self.extraHash = []
5937 else:
5938 self.extraHash = extraHash
5944 factory = staticmethod(factory)
5954 - def set_size(self, size): self.size = size
5958 - def set_fileType(self, fileType): self.fileType = fileType
5959 - def add_fileType(self, value): self.fileType.append(value)
5967 - def export(self, outfile, level, namespace_='maec:', name_='fileObject', namespacedef_=''):
5968 showIndent(outfile, level)
5969 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
5970 already_processed = []
5971 self.exportAttributes(outfile, level, already_processed, namespace_, name_='fileObject')
5972 if self.hasContent_():
5973 outfile.write('>\n')
5974 self.exportChildren(outfile, level + 1, namespace_, name_)
5975 showIndent(outfile, level)
5976 outfile.write('</%s%s>\n' % (namespace_, name_))
5977 else:
5978 outfile.write('/>\n')
5979 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='fileObject'):
5980 if self.id is not None and 'id' not in already_processed:
5981 already_processed.append('id')
5982 outfile.write(' id=%s' % (quote_attrib(self.id), ))
5983 - def exportChildren(self, outfile, level, namespace_='maec:', name_='fileObject', fromsubclass_=False):
5984 if self.md5 is not None:
5985 showIndent(outfile, level)
5986 outfile.write('<%smd5>%s</%smd5>\n' % (namespace_, self.gds_format_string(quote_xml(self.md5).encode(ExternalEncoding), input_name='md5'), namespace_))
5987 if self.sha1 is not None:
5988 showIndent(outfile, level)
5989 outfile.write('<%ssha1>%s</%ssha1>\n' % (namespace_, self.gds_format_string(quote_xml(self.sha1).encode(ExternalEncoding), input_name='sha1'), namespace_))
5990 if self.sha256 is not None:
5991 showIndent(outfile, level)
5992 outfile.write('<%ssha256>%s</%ssha256>\n' % (namespace_, self.gds_format_string(quote_xml(self.sha256).encode(ExternalEncoding), input_name='sha256'), namespace_))
5993 if self.sha512 is not None:
5994 showIndent(outfile, level)
5995 outfile.write('<%ssha512>%s</%ssha512>\n' % (namespace_, self.gds_format_string(quote_xml(self.sha512).encode(ExternalEncoding), input_name='sha512'), namespace_))
5996 if self.size is not None:
5997 showIndent(outfile, level)
5998 outfile.write('<%ssize>%s</%ssize>\n' % (namespace_, self.gds_format_integer(self.size, input_name='size'), namespace_))
5999 if self.crc32 is not None:
6000 showIndent(outfile, level)
6001 outfile.write('<%scrc32>%s</%scrc32>\n' % (namespace_, self.gds_format_string(quote_xml(self.crc32).encode(ExternalEncoding), input_name='crc32'), namespace_))
6002 for fileType_ in self.fileType:
6003 showIndent(outfile, level)
6004 outfile.write('<%sfileType>%s</%sfileType>\n' % (namespace_, self.gds_format_string(quote_xml(fileType_).encode(ExternalEncoding), input_name='fileType'), namespace_))
6005 for extraHash_ in self.extraHash:
6006 extraHash_.export(outfile, level, namespace_, name_='extraHash')
6007 - def hasContent_(self):
6008 if (
6009 self.md5 is not None or
6010 self.sha1 is not None or
6011 self.sha256 is not None or
6012 self.sha512 is not None or
6013 self.size is not None or
6014 self.crc32 is not None or
6015 self.fileType or
6016 self.extraHash
6017 ):
6018 return True
6019 else:
6020 return False
6027 if self.id is not None and 'id' not in already_processed:
6028 already_processed.append('id')
6029 showIndent(outfile, level)
6030 outfile.write('id = %s,\n' % (self.id,))
6032 if self.md5 is not None:
6033 showIndent(outfile, level)
6034 outfile.write('md5=model_.xs_hexBinary(\n')
6035 self.md5.exportLiteral(outfile, level, name_='md5')
6036 showIndent(outfile, level)
6037 outfile.write('),\n')
6038 if self.sha1 is not None:
6039 showIndent(outfile, level)
6040 outfile.write('sha1=model_.xs_hexBinary(\n')
6041 self.sha1.exportLiteral(outfile, level, name_='sha1')
6042 showIndent(outfile, level)
6043 outfile.write('),\n')
6044 if self.sha256 is not None:
6045 showIndent(outfile, level)
6046 outfile.write('sha256=model_.xs_hexBinary(\n')
6047 self.sha256.exportLiteral(outfile, level, name_='sha256')
6048 showIndent(outfile, level)
6049 outfile.write('),\n')
6050 if self.sha512 is not None:
6051 showIndent(outfile, level)
6052 outfile.write('sha512=model_.xs_hexBinary(\n')
6053 self.sha512.exportLiteral(outfile, level, name_='sha512')
6054 showIndent(outfile, level)
6055 outfile.write('),\n')
6056 if self.size is not None:
6057 showIndent(outfile, level)
6058 outfile.write('size=%d,\n' % self.size)
6059 if self.crc32 is not None:
6060 showIndent(outfile, level)
6061 outfile.write('crc32=%s,\n' % quote_python(self.crc32).encode(ExternalEncoding))
6062 showIndent(outfile, level)
6063 outfile.write('fileType=[\n')
6064 level += 1
6065 for fileType_ in self.fileType:
6066 showIndent(outfile, level)
6067 outfile.write('%s,\n' % quote_python(fileType_).encode(ExternalEncoding))
6068 level -= 1
6069 showIndent(outfile, level)
6070 outfile.write('],\n')
6071 showIndent(outfile, level)
6072 outfile.write('extraHash=[\n')
6073 level += 1
6074 for extraHash_ in self.extraHash:
6075 showIndent(outfile, level)
6076 outfile.write('model_.extraHashType(\n')
6077 extraHash_.exportLiteral(outfile, level, name_='extraHashType')
6078 showIndent(outfile, level)
6079 outfile.write('),\n')
6080 level -= 1
6081 showIndent(outfile, level)
6082 outfile.write('],\n')
6089 value = find_attr_value_('id', node)
6090 if value is not None and 'id' not in already_processed:
6091 already_processed.append('id')
6092 self.id = value
6093 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
6094 if nodeName_ == 'md5':
6095 obj_ = xs_hexBinary.factory()
6096 obj_.build(child_)
6097 self.set_md5(obj_)
6098 elif nodeName_ == 'sha1':
6099 obj_ = xs_hexBinary.factory()
6100 obj_.build(child_)
6101 self.set_sha1(obj_)
6102 elif nodeName_ == 'sha256':
6103 obj_ = xs_hexBinary.factory()
6104 obj_.build(child_)
6105 self.set_sha256(obj_)
6106 elif nodeName_ == 'sha512':
6107 obj_ = xs_hexBinary.factory()
6108 obj_.build(child_)
6109 self.set_sha512(obj_)
6110 elif nodeName_ == 'size':
6111 sval_ = child_.text
6112 try:
6113 ival_ = int(sval_)
6114 except (TypeError, ValueError) as e:
6115 raise_parse_error(child_, 'requires integer: %s' % e)
6116 ival_ = self.gds_validate_integer(ival_, node, 'size')
6117 self.size = ival_
6118 elif nodeName_ == 'crc32':
6119 crc32_ = child_.text
6120 crc32_ = self.gds_validate_string(crc32_, node, 'crc32')
6121 self.crc32 = crc32_
6122 elif nodeName_ == 'fileType':
6123 fileType_ = child_.text
6124 fileType_ = self.gds_validate_string(fileType_, node, 'fileType')
6125 self.fileType.append(fileType_)
6126 elif nodeName_ == 'extraHash':
6127 obj_ = extraHashType.factory()
6128 obj_.build(child_)
6129 self.extraHash.append(obj_)
6130
6131
6132
6134 """Registry object. The required attribute is 'id', which is taken to
6135 be key\\valueName. Keys end in a \, value names start with a \,
6136 so you have e.g. key =
6137 hklm\software\microsoft\currentversion\windows\run\ value =\foo
6138 making the id
6139 hklm\software\microsoft\currentversion\windows\run\\foo"""
6140 subclass = None
6141 superclass = None
6142 - def __init__(self, id=None, key=None, valueName=None):
6143 self.id = _cast(None, id)
6144 self.key = key
6145 self.valueName = valueName
6151 factory = staticmethod(factory)
6152 - def get_key(self): return self.key
6153 - def set_key(self, key): self.key = key
6158 - def export(self, outfile, level, namespace_='maec:', name_='registryObject', namespacedef_=''):
6159 showIndent(outfile, level)
6160 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
6161 already_processed = []
6162 self.exportAttributes(outfile, level, already_processed, namespace_, name_='registryObject')
6163 if self.hasContent_():
6164 outfile.write('>\n')
6165 self.exportChildren(outfile, level + 1, namespace_, name_)
6166 showIndent(outfile, level)
6167 outfile.write('</%s%s>\n' % (namespace_, name_))
6168 else:
6169 outfile.write('/>\n')
6170 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='registryObject'):
6174 - def exportChildren(self, outfile, level, namespace_='maec:', name_='registryObject', fromsubclass_=False):
6181 - def hasContent_(self):
6182 if (
6183 self.key is not None or
6184 self.valueName is not None
6185 ):
6186 return True
6187 else:
6188 return False
6189 - def exportLiteral(self, outfile, level, name_='registryObject'):
6195 if self.id is not None and 'id' not in already_processed:
6196 already_processed.append('id')
6197 showIndent(outfile, level)
6198 outfile.write('id = "%s",\n' % (self.id,))
6212 value = find_attr_value_('id', node)
6213 if value is not None and 'id' not in already_processed:
6214 already_processed.append('id')
6215 self.id = value
6216 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
6217 if nodeName_ == 'key':
6218 key_ = child_.text
6219 key_ = self.gds_validate_string(key_, node, 'key')
6220 self.key = key_
6221 elif nodeName_ == 'valueName':
6222 valueName_ = child_.text
6223 valueName_ = self.gds_validate_string(valueName_, node, 'valueName')
6224 self.valueName = valueName_
6225
6226
6227
6229 """Entity Object. This is used to record groups, companies etc., and
6230 departments within organizations. The globally unique id
6231 (attribute) should be constructed from the company and
6232 department name, e.g. "Company name:Department name",
6233 "Mcafee:AVERT labs", or "Russian Business Network"."""
6234 subclass = None
6235 superclass = None
6236 - def __init__(self, id=None, name=None):
6244 factory = staticmethod(factory)
6249 - def export(self, outfile, level, namespace_='maec:', name_='entityObject', namespacedef_=''):
6250 showIndent(outfile, level)
6251 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
6252 already_processed = []
6253 self.exportAttributes(outfile, level, already_processed, namespace_, name_='entityObject')
6254 if self.hasContent_():
6255 outfile.write('>\n')
6256 self.exportChildren(outfile, level + 1, namespace_, name_)
6257 showIndent(outfile, level)
6258 outfile.write('</%s%s>\n' % (namespace_, name_))
6259 else:
6260 outfile.write('/>\n')
6261 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='entityObject'):
6265 - def exportChildren(self, outfile, level, namespace_='maec:', name_='entityObject', fromsubclass_=False):
6269 - def hasContent_(self):
6270 if (
6271 self.name is not None
6272 ):
6273 return True
6274 else:
6275 return False
6282 if self.id is not None and 'id' not in already_processed:
6283 already_processed.append('id')
6284 showIndent(outfile, level)
6285 outfile.write('id = "%s",\n' % (self.id,))
6296 value = find_attr_value_('id', node)
6297 if value is not None and 'id' not in already_processed:
6298 already_processed.append('id')
6299 self.id = value
6300 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
6301 if nodeName_ == 'name':
6302 name_ = child_.text
6303 name_ = self.gds_validate_string(name_, node, 'name')
6304 self.name = name_
6305
6306
6307
6309 """Uri object. Only required element is uri string itself. There are
6310 elements for each of the broken out elements. The protocol
6311 should be take from the list at http://www.iana.org/assignments
6312 /port-numbers, or if not in that list have the value 'unknown'.
6313 The ipProtocol should be taken from the list
6314 http://www.iana.org/assignments/protocol-numbers/. The elements
6315 correspond to the usual breakdown of a uri into its component
6316 domain, hostname, path, port etc, as described at
6317 http://en.wikipedia.org/wiki/Uniform_Resource_Locator."""
6318 subclass = None
6319 superclass = None
6320 - def __init__(self, id=None, uriString=None, protocol=None, hostname=None, domain=None, port=None, path=None, ipProtocol=None):
6321 self.id = _cast(None, id)
6322 self.uriString = uriString
6323 self.protocol = protocol
6324 self.hostname = hostname
6325 self.domain = domain
6326 self.port = port
6327 self.path = path
6328 self.ipProtocol = ipProtocol
6334 factory = staticmethod(factory)
6341 - def set_protocol(self, protocol): self.protocol = protocol
6343 - def set_hostname(self, hostname): self.hostname = hostname
6344 - def get_domain(self): return self.domain
6345 - def set_domain(self, domain): self.domain = domain
6347 - def set_port(self, port): self.port = port
6349 - def set_path(self, path): self.path = path
6354 - def export(self, outfile, level, namespace_='maec:', name_='uriObject', namespacedef_=''):
6355 showIndent(outfile, level)
6356 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
6357 already_processed = []
6358 self.exportAttributes(outfile, level, already_processed, namespace_, name_='uriObject')
6359 if self.hasContent_():
6360 outfile.write('>\n')
6361 self.exportChildren(outfile, level + 1, namespace_, name_)
6362 showIndent(outfile, level)
6363 outfile.write('</%s%s>\n' % (namespace_, name_))
6364 else:
6365 outfile.write('/>\n')
6366 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='uriObject'):
6367 if self.id is not None and 'id' not in already_processed:
6368 already_processed.append('id')
6369 outfile.write(' id=%s' % (quote_attrib(self.id), ))
6370 - def exportChildren(self, outfile, level, namespace_='maec:', name_='uriObject', fromsubclass_=False):
6371 if self.uriString is not None:
6372 showIndent(outfile, level)
6373 outfile.write('<%suriString>%s</%suriString>\n' % (namespace_, self.gds_format_string(quote_xml(self.uriString).encode(ExternalEncoding), input_name='uriString'), namespace_))
6374 if self.protocol is not None:
6375 showIndent(outfile, level)
6376 outfile.write('<%sprotocol>%s</%sprotocol>\n' % (namespace_, self.gds_format_string(quote_xml(self.protocol).encode(ExternalEncoding), input_name='protocol'), namespace_))
6377 if self.hostname is not None:
6378 showIndent(outfile, level)
6379 outfile.write('<%shostname>%s</%shostname>\n' % (namespace_, self.gds_format_string(quote_xml(self.hostname).encode(ExternalEncoding), input_name='hostname'), namespace_))
6380 if self.domain is not None:
6381 showIndent(outfile, level)
6382 outfile.write('<%sdomain>%s</%sdomain>\n' % (namespace_, self.gds_format_string(quote_xml(self.domain).encode(ExternalEncoding), input_name='domain'), namespace_))
6383 if self.port is not None:
6384 showIndent(outfile, level)
6385 outfile.write('<%sport>%s</%sport>\n' % (namespace_, self.gds_format_integer(self.port, input_name='port'), namespace_))
6386 if self.path is not None:
6387 showIndent(outfile, level)
6388 outfile.write('<%spath>%s</%spath>\n' % (namespace_, self.gds_format_string(quote_xml(self.path).encode(ExternalEncoding), input_name='path'), namespace_))
6389 if self.ipProtocol is not None:
6390 showIndent(outfile, level)
6391 outfile.write('<%sipProtocol>%s</%sipProtocol>\n' % (namespace_, self.gds_format_string(quote_xml(self.ipProtocol).encode(ExternalEncoding), input_name='ipProtocol'), namespace_))
6392 - def hasContent_(self):
6393 if (
6394 self.uriString is not None or
6395 self.protocol is not None or
6396 self.hostname is not None or
6397 self.domain is not None or
6398 self.port is not None or
6399 self.path is not None or
6400 self.ipProtocol is not None
6401 ):
6402 return True
6403 else:
6404 return False
6411 if self.id is not None and 'id' not in already_processed:
6412 already_processed.append('id')
6413 showIndent(outfile, level)
6414 outfile.write('id = "%s",\n' % (self.id,))
6416 if self.uriString is not None:
6417 showIndent(outfile, level)
6418 outfile.write('uriString=%s,\n' % quote_python(self.uriString).encode(ExternalEncoding))
6419 if self.protocol is not None:
6420 showIndent(outfile, level)
6421 outfile.write('protocol=%s,\n' % quote_python(self.protocol).encode(ExternalEncoding))
6422 if self.hostname is not None:
6423 showIndent(outfile, level)
6424 outfile.write('hostname=%s,\n' % quote_python(self.hostname).encode(ExternalEncoding))
6425 if self.domain is not None:
6426 showIndent(outfile, level)
6427 outfile.write('domain=%s,\n' % quote_python(self.domain).encode(ExternalEncoding))
6428 if self.port is not None:
6429 showIndent(outfile, level)
6430 outfile.write('port=%d,\n' % self.port)
6431 if self.path is not None:
6432 showIndent(outfile, level)
6433 outfile.write('path=%s,\n' % quote_python(self.path).encode(ExternalEncoding))
6434 if self.ipProtocol is not None:
6435 showIndent(outfile, level)
6436 outfile.write('ipProtocol=%s,\n' % quote_python(self.ipProtocol).encode(ExternalEncoding))
6448 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
6449 if nodeName_ == 'uriString':
6450 uriString_ = child_.text
6451 uriString_ = self.gds_validate_string(uriString_, node, 'uriString')
6452 self.uriString = uriString_
6453 self.validate_NoQuestionMark(self.uriString)
6454 elif nodeName_ == 'protocol':
6455 protocol_ = child_.text
6456 protocol_ = self.gds_validate_string(protocol_, node, 'protocol')
6457 self.protocol = protocol_
6458 elif nodeName_ == 'hostname':
6459 hostname_ = child_.text
6460 hostname_ = self.gds_validate_string(hostname_, node, 'hostname')
6461 self.hostname = hostname_
6462 elif nodeName_ == 'domain':
6463 domain_ = child_.text
6464 domain_ = self.gds_validate_string(domain_, node, 'domain')
6465 self.domain = domain_
6466 elif nodeName_ == 'port':
6467 sval_ = child_.text
6468 try:
6469 ival_ = int(sval_)
6470 except (TypeError, ValueError) as e:
6471 raise_parse_error(child_, 'requires integer: %s' % e)
6472 ival_ = self.gds_validate_integer(ival_, node, 'port')
6473 self.port = ival_
6474 elif nodeName_ == 'path':
6475 path_ = child_.text
6476 path_ = self.gds_validate_string(path_, node, 'path')
6477 self.path = path_
6478 elif nodeName_ == 'ipProtocol':
6479 ipProtocol_ = child_.text
6480 ipProtocol_ = self.gds_validate_string(ipProtocol_, node, 'ipProtocol')
6481 self.ipProtocol = ipProtocol_
6482
6483
6484
6486 """IP object. Used to hold ipv4, ipv6 ip addresses and address ranges.
6487 The globally unique id is 'startAddress-endAddress'. There are
6488 two required elements, startAddress and endAddress, make these
6489 the same if you are specifying a single address. Thus for ip
6490 range id, would be e.g. 213.23.45.7-213.23.45.19 For a single
6491 ip, id would be e.g. 12.34.56.1-12.34.56.1"""
6492 subclass = None
6493 superclass = None
6494 - def __init__(self, id=None, startAddress=None, endAddress=None):
6495 self.id = _cast(None, id)
6496 self.startAddress = startAddress
6497 self.endAddress = endAddress
6503 factory = staticmethod(factory)
6513 - def export(self, outfile, level, namespace_='maec:', name_='IPObject', namespacedef_=''):
6514 showIndent(outfile, level)
6515 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
6516 already_processed = []
6517 self.exportAttributes(outfile, level, already_processed, namespace_, name_='IPObject')
6518 if self.hasContent_():
6519 outfile.write('>\n')
6520 self.exportChildren(outfile, level + 1, namespace_, name_)
6521 showIndent(outfile, level)
6522 outfile.write('</%s%s>\n' % (namespace_, name_))
6523 else:
6524 outfile.write('/>\n')
6525 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='IPObject'):
6526 if self.id is not None and 'id' not in already_processed:
6527 already_processed.append('id')
6528 outfile.write(' id=%s' % (quote_attrib(self.id), ))
6529 - def exportChildren(self, outfile, level, namespace_='maec:', name_='IPObject', fromsubclass_=False):
6530 if self.startAddress is not None:
6531 self.startAddress.export(outfile, level, namespace_, name_='startAddress', )
6532 if self.endAddress is not None:
6533 self.endAddress.export(outfile, level, namespace_, name_='endAddress', )
6534 - def hasContent_(self):
6535 if (
6536 self.startAddress is not None or
6537 self.endAddress is not None
6538 ):
6539 return True
6540 else:
6541 return False
6548 if self.id is not None and 'id' not in already_processed:
6549 already_processed.append('id')
6550 showIndent(outfile, level)
6551 outfile.write('id = "%s",\n' % (self.id,))
6553 if self.startAddress is not None:
6554 showIndent(outfile, level)
6555 outfile.write('startAddress=model_.IPAddress(\n')
6556 self.startAddress.exportLiteral(outfile, level, name_='startAddress')
6557 showIndent(outfile, level)
6558 outfile.write('),\n')
6559 if self.endAddress is not None:
6560 showIndent(outfile, level)
6561 outfile.write('endAddress=model_.IPAddress(\n')
6562 self.endAddress.exportLiteral(outfile, level, name_='endAddress')
6563 showIndent(outfile, level)
6564 outfile.write('),\n')
6571 value = find_attr_value_('id', node)
6572 if value is not None and 'id' not in already_processed:
6573 already_processed.append('id')
6574 self.id = value
6575 self.validate_IPRange(self.id)
6576 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
6585
6586
6587
6589 """ip address - string for the actual address and attribute either
6590 ipv4, ipv6."""
6591 subclass = None
6592 superclass = None
6593 - def __init__(self, type_=None, valueOf_=None):
6594 self.type_ = _cast(None, type_)
6595 self.valueOf_ = valueOf_
6601 factory = staticmethod(factory)
6603 - def set_type(self, type_): self.type_ = type_
6608 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
6609 - def export(self, outfile, level, namespace_='maec:', name_='IPAddress', namespacedef_=''):
6610 showIndent(outfile, level)
6611 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
6612 already_processed = []
6613 self.exportAttributes(outfile, level, already_processed, namespace_, name_='IPAddress')
6614 if self.hasContent_():
6615 outfile.write('>')
6616 outfile.write(str(self.valueOf_).encode(ExternalEncoding))
6617 self.exportChildren(outfile, level + 1, namespace_, name_)
6618 outfile.write('</%s%s>\n' % (namespace_, name_))
6619 else:
6620 outfile.write('/>\n')
6621 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='IPAddress'):
6622 if self.type_ is not None and 'type_' not in already_processed:
6623 already_processed.append('type_')
6624 outfile.write(' type=%s' % (quote_attrib(self.type_), ))
6625 - def exportChildren(self, outfile, level, namespace_='maec:', name_='IPAddress', fromsubclass_=False):
6627 - def hasContent_(self):
6628 if (
6629 self.valueOf_
6630 ):
6631 return True
6632 else:
6633 return False
6642 if self.type_ is not None and 'type_' not in already_processed:
6643 already_processed.append('type_')
6644 showIndent(outfile, level)
6645 outfile.write('type_ = "%s",\n' % (self.type_,))
6655 value = find_attr_value_('type', node)
6656 if value is not None and 'type' not in already_processed:
6657 already_processed.append('type')
6658 self.type_ = value
6659 self.validate_IPTypeEnum(self.type_)
6660 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
6662
6663
6664
6665 -class domainObject(GeneratedsSuper):
6666 """Domain object, used to hold internet domains, e.g.yahoo.com. The
6667 globally unique identifier (id attribute) is the domain itself.
6668 whois information on domain is recorded using object properties."""
6669 subclass = None
6670 superclass = None
6671 - def __init__(self, id=None, domain=None):
6672 self.id = _cast(None, id)
6673 self.domain = domain
6674 - def factory(*args_, **kwargs_):
6675 if domainObject.subclass:
6676 return domainObject.subclass(*args_, **kwargs_)
6677 else:
6678 return domainObject(*args_, **kwargs_)
6679 factory = staticmethod(factory)
6680 - def get_domain(self): return self.domain
6681 - def set_domain(self, domain): self.domain = domain
6682 - def get_id(self): return self.id
6683 - def set_id(self, id): self.id = id
6684 - def export(self, outfile, level, namespace_='maec:', name_='domainObject', namespacedef_=''):
6685 showIndent(outfile, level)
6686 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
6687 already_processed = []
6688 self.exportAttributes(outfile, level, already_processed, namespace_, name_='domainObject')
6689 if self.hasContent_():
6690 outfile.write('>\n')
6691 self.exportChildren(outfile, level + 1, namespace_, name_)
6692 showIndent(outfile, level)
6693 outfile.write('</%s%s>\n' % (namespace_, name_))
6694 else:
6695 outfile.write('/>\n')
6696 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='domainObject'):
6697 if self.id is not None and 'id' not in already_processed:
6698 already_processed.append('id')
6699 outfile.write(' id=%s' % (self.gds_format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))
6700 - def exportChildren(self, outfile, level, namespace_='maec:', name_='domainObject', fromsubclass_=False):
6701 if self.domain is not None:
6702 showIndent(outfile, level)
6703 outfile.write('<%sdomain>%s</%sdomain>\n' % (namespace_, self.gds_format_string(quote_xml(self.domain).encode(ExternalEncoding), input_name='domain'), namespace_))
6704 - def hasContent_(self):
6705 if (
6706 self.domain is not None
6707 ):
6708 return True
6709 else:
6710 return False
6711 - def exportLiteral(self, outfile, level, name_='domainObject'):
6712 level += 1
6713 self.exportLiteralAttributes(outfile, level, [], name_)
6714 if self.hasContent_():
6715 self.exportLiteralChildren(outfile, level, name_)
6716 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
6717 if self.id is not None and 'id' not in already_processed:
6718 already_processed.append('id')
6719 showIndent(outfile, level)
6720 outfile.write('id = "%s",\n' % (self.id,))
6721 - def exportLiteralChildren(self, outfile, level, name_):
6722 if self.domain is not None:
6723 showIndent(outfile, level)
6724 outfile.write('domain=%s,\n' % quote_python(self.domain).encode(ExternalEncoding))
6725 - def build(self, node):
6726 self.buildAttributes(node, node.attrib, [])
6727 for child in node:
6728 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
6729 self.buildChildren(child, node, nodeName_)
6730 - def buildAttributes(self, node, attrs, already_processed):
6731 value = find_attr_value_('id', node)
6732 if value is not None and 'id' not in already_processed:
6733 already_processed.append('id')
6734 self.id = value
6735 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
6736 if nodeName_ == 'domain':
6737 domain_ = child_.text
6738 domain_ = self.gds_validate_string(domain_, node, 'domain')
6739 self.domain = domain_
6740
6741
6742
6744 """Object used to hold information on Autonomous System Numbers. An
6745 autonomous system (AS) is a collection of connected Internet
6746 Protocol (IP) routing prefixes under the control of one or more
6747 network operators that presents a common, clearly defined
6748 routing policy to the Internet. The id is the number, written as
6749 an integer for both 16 and 32 bit numbers."""
6750 subclass = None
6751 superclass = None
6752 - def __init__(self, id=None, as_number=None):
6753 self.id = _cast(int, id)
6754 self.as_number = as_number
6760 factory = staticmethod(factory)
6765 - def export(self, outfile, level, namespace_='maec:', name_='ASNObject', namespacedef_=''):
6766 showIndent(outfile, level)
6767 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
6768 already_processed = []
6769 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ASNObject')
6770 if self.hasContent_():
6771 outfile.write('>\n')
6772 self.exportChildren(outfile, level + 1, namespace_, name_)
6773 showIndent(outfile, level)
6774 outfile.write('</%s%s>\n' % (namespace_, name_))
6775 else:
6776 outfile.write('/>\n')
6777 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ASNObject'):
6778 if self.id is not None and 'id' not in already_processed:
6779 already_processed.append('id')
6780 outfile.write(' id="%s"' % self.gds_format_integer(self.id, input_name='id'))
6781 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ASNObject', fromsubclass_=False):
6782 if self.as_number is not None:
6783 showIndent(outfile, level)
6784 outfile.write('<%sas-number>%s</%sas-number>\n' % (namespace_, self.gds_format_integer(self.as_number, input_name='as-number'), namespace_))
6785 - def hasContent_(self):
6786 if (
6787 self.as_number is not None
6788 ):
6789 return True
6790 else:
6791 return False
6798 if self.id is not None and 'id' not in already_processed:
6799 already_processed.append('id')
6800 showIndent(outfile, level)
6801 outfile.write('id = %d,\n' % (self.id,))
6803 if self.as_number is not None:
6804 showIndent(outfile, level)
6805 outfile.write('as_number=%d,\n' % self.as_number)
6812 value = find_attr_value_('id', node)
6813 if value is not None and 'id' not in already_processed:
6814 already_processed.append('id')
6815 try:
6816 self.id = int(value)
6817 except ValueError as e:
6818 raise_parse_error(node, 'Bad integer attribute: %s' % e)
6819 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
6820 if nodeName_ == 'as-number':
6821 sval_ = child_.text
6822 try:
6823 ival_ = int(sval_)
6824 except (TypeError, ValueError) as e:
6825 raise_parse_error(child_, 'requires integer: %s' % e)
6826 ival_ = self.gds_validate_integer(ival_, node, 'as_number')
6827 self.as_number = ival_
6828
6829
6830
6832 """Classification object, used to hold names or classifications of
6833 objects. The most common use case for this is detection names
6834 for files from av scanners. However, this object could be used
6835 for general classification. The globally unique id (attribute)
6836 should be created from "Company name:internal classification
6837 name", e.g. "Mcafee:Generic.DX". The other required attribute is
6838 the type of classification, e.g. clean, dirty, unknown. There
6839 are elements to capture the category of the classification. The
6840 category should be entered in the same way to the classification
6841 name, e.g. company name:category name, e..g Mcafee:Trojan."""
6842 subclass = None
6843 superclass = None
6844 - def __init__(self, type_=None, id=None, classificationName=None, companyName=None, category=None, classificationDetails=None):
6845 self.type_ = _cast(None, type_)
6846 self.id = _cast(None, id)
6847 self.classificationName = classificationName
6848 self.companyName = companyName
6849 self.category = category
6850 self.classificationDetails = classificationDetails
6856 factory = staticmethod(factory)
6866 - def set_type(self, type_): self.type_ = type_
6872 - def export(self, outfile, level, namespace_='maec:', name_='classificationObject', namespacedef_=''):
6873 showIndent(outfile, level)
6874 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
6875 already_processed = []
6876 self.exportAttributes(outfile, level, already_processed, namespace_, name_='classificationObject')
6877 if self.hasContent_():
6878 outfile.write('>\n')
6879 self.exportChildren(outfile, level + 1, namespace_, name_)
6880 showIndent(outfile, level)
6881 outfile.write('</%s%s>\n' % (namespace_, name_))
6882 else:
6883 outfile.write('/>\n')
6884 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='classificationObject'):
6885 if self.type_ is not None and 'type_' not in already_processed:
6886 already_processed.append('type_')
6887 outfile.write(' type=%s' % (quote_attrib(self.type_), ))
6888 if self.id is not None and 'id' not in already_processed:
6889 already_processed.append('id')
6890 outfile.write(' id=%s' % (self.gds_format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))
6891 - def exportChildren(self, outfile, level, namespace_='maec:', name_='classificationObject', fromsubclass_=False):
6892 if self.classificationName is not None:
6893 showIndent(outfile, level)
6894 outfile.write('<%sclassificationName>%s</%sclassificationName>\n' % (namespace_, self.gds_format_string(quote_xml(self.classificationName).encode(ExternalEncoding), input_name='classificationName'), namespace_))
6895 if self.companyName is not None:
6896 showIndent(outfile, level)
6897 outfile.write('<%scompanyName>%s</%scompanyName>\n' % (namespace_, self.gds_format_string(quote_xml(self.companyName).encode(ExternalEncoding), input_name='companyName'), namespace_))
6898 if self.category is not None:
6899 showIndent(outfile, level)
6900 outfile.write('<%scategory>%s</%scategory>\n' % (namespace_, self.gds_format_string(quote_xml(self.category).encode(ExternalEncoding), input_name='category'), namespace_))
6901 if self.classificationDetails is not None:
6902 self.classificationDetails.export(outfile, level, namespace_, name_='classificationDetails')
6903 - def hasContent_(self):
6904 if (
6905 self.classificationName is not None or
6906 self.companyName is not None or
6907 self.category is not None or
6908 self.classificationDetails is not None
6909 ):
6910 return True
6911 else:
6912 return False
6913 - def exportLiteral(self, outfile, level, name_='classificationObject'):
6919 if self.type_ is not None and 'type_' not in already_processed:
6920 already_processed.append('type_')
6921 showIndent(outfile, level)
6922 outfile.write('type_ = "%s",\n' % (self.type_,))
6923 if self.id is not None and 'id' not in already_processed:
6924 already_processed.append('id')
6925 showIndent(outfile, level)
6926 outfile.write('id = "%s",\n' % (self.id,))
6928 if self.classificationName is not None:
6929 showIndent(outfile, level)
6930 outfile.write('classificationName=%s,\n' % quote_python(self.classificationName).encode(ExternalEncoding))
6931 if self.companyName is not None:
6932 showIndent(outfile, level)
6933 outfile.write('companyName=%s,\n' % quote_python(self.companyName).encode(ExternalEncoding))
6934 if self.category is not None:
6935 showIndent(outfile, level)
6936 outfile.write('category=%s,\n' % quote_python(self.category).encode(ExternalEncoding))
6937 if self.classificationDetails is not None:
6938 showIndent(outfile, level)
6939 outfile.write('classificationDetails=model_.classificationDetailsType(\n')
6940 self.classificationDetails.exportLiteral(outfile, level, name_='classificationDetails')
6941 showIndent(outfile, level)
6942 outfile.write('),\n')
6949 value = find_attr_value_('type', node)
6950 if value is not None and 'type' not in already_processed:
6951 already_processed.append('type')
6952 self.type_ = value
6953 self.validate_ClassificationTypeEnum(self.type_)
6954 value = find_attr_value_('id', node)
6955 if value is not None and 'id' not in already_processed:
6956 already_processed.append('id')
6957 self.id = value
6958 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
6959 if nodeName_ == 'classificationName':
6960 classificationName_ = child_.text
6961 classificationName_ = self.gds_validate_string(classificationName_, node, 'classificationName')
6962 self.classificationName = classificationName_
6963 elif nodeName_ == 'companyName':
6964 companyName_ = child_.text
6965 companyName_ = self.gds_validate_string(companyName_, node, 'companyName')
6966 self.companyName = companyName_
6967 elif nodeName_ == 'category':
6968 category_ = child_.text
6969 category_ = self.gds_validate_string(category_, node, 'category')
6970 self.category = category_
6971 elif nodeName_ == 'classificationDetails':
6972 obj_ = classificationDetailsType.factory()
6973 obj_.build(child_)
6974 self.set_classificationDetails(obj_)
6975
6976
6977
6978 -class fieldDataEntry(GeneratedsSuper):
6979 """Data structure to hold prevalence information. The data includes a
6980 reference to another object (which is an xpath expression
6981 pointing to an object inside the 'ref' element), together with a
6982 time period (startDate -> endDate), an origin - where the object
6983 came from, and various location tags. This allows rich
6984 information on prevalence to be recorded. By convention, time
6985 periods should be wherever possible standard time periods, e.g.
6986 minute, hour, 24 hours, week, month, quarter, year. This will
6987 facilitate combination of data from multiple sources. To
6988 represent a single entry, make startDate == endDate. Commonality
6989 is calculated from the sightings of malware objects (and so such
6990 calculation is easier to automate). Importance is reserved for
6991 cases when “commonality” is not available or if there is a
6992 need to communicate the importance when commonality is low. We
6993 define the commonality on a scale 0 to 100 (0 means “never
6994 found in the field” and 100 means “found very
6995 frequently”). Scaling commonality to 0..100 range instead of
6996 using actual sample counts is to avoid the effect of the user
6997 base size on the commonality. We derive commonality from the
6998 number of affected computers – not from the number of samples
6999 (for example, a hundred parasitic infections of the same virus
7000 on a single computer are to be counted as one). To calculate the
7001 commonality we use two-stage approach and logarithmic scale: -
7002 If the number of affected users exceeds 0.1% of your user base
7003 (more frequent than 1 in a 1000) set commonality to “100” -
7004 Otherwise, calculate the ratio of infected computers amongst
7005 your user base by dividing the real number of affected computers
7006 ‘n’ by the total number ‘N’ - Apply the following
7007 formula to get the commonality –( log2(1+n*1000/N) ) * 100 -
7008 Round to the closest integer Obviously, the calculation above
7009 can only be applied to counting of malware sightings on
7010 desktops. If telemetry is collected from a fraction of such
7011 desktops then an appropriate correction should be used. For all
7012 other cases (e.g. sighting on gateways, in some network security
7013 appliance, on an ISP level, etc.) please exercise your best
7014 judgment and apply provided desktop guideline as an example to
7015 make sure the commonality factor is as comparable as possible.
7016 For a URL object the commonality could reflect, for example, how
7017 widely it was spammed. “Importance” should not be used
7018 together with “commonality” (unless commonality=“0”) to
7019 avoid possible confusion. High “importance”, for example,
7020 can be assigned to samples that are over-hyped by media when
7021 their commonality is still “0”. Use the following guidelines
7022 for “importance” which is also defined on a scale 0..100:
7023 100 – you’d expect your CEO and/or media to call you any
7024 second about this object 80 – you might get a call from your
7025 CEO and/or media 60 – you’d expect your boss to call you any
7026 second 40 – you might get a call from your boss 20 – someone
7027 is very likely to contact you about this object 10 – you might
7028 get contacted about this object 0 – you’d be surprised if
7029 anyone would ever contact you about this object"""
7030 subclass = None
7031 superclass = None
7032 - def __init__(self, references=None, startDate=None, endDate=None, firstSeenDate=None, origin=None, commonality=None, volume=None, importance=None, location=None):
7033 self.references = references
7034 self.startDate = startDate
7035 self.endDate = endDate
7036 self.firstSeenDate = firstSeenDate
7037 self.origin = origin
7038 self.commonality = commonality
7039 if volume is None:
7040 self.volume = []
7041 else:
7042 self.volume = volume
7043 self.importance = importance
7044 self.location = location
7045 - def factory(*args_, **kwargs_):
7046 if fieldDataEntry.subclass:
7047 return fieldDataEntry.subclass(*args_, **kwargs_)
7048 else:
7049 return fieldDataEntry(*args_, **kwargs_)
7050 factory = staticmethod(factory)
7051 - def get_references(self): return self.references
7052 - def set_references(self, references): self.references = references
7053 - def get_startDate(self): return self.startDate
7054 - def set_startDate(self, startDate): self.startDate = startDate
7055 - def get_endDate(self): return self.endDate
7056 - def set_endDate(self, endDate): self.endDate = endDate
7057 - def get_firstSeenDate(self): return self.firstSeenDate
7058 - def set_firstSeenDate(self, firstSeenDate): self.firstSeenDate = firstSeenDate
7059 - def get_origin(self): return self.origin
7060 - def set_origin(self, origin): self.origin = origin
7061 - def validate_OriginTypeEnum(self, value):
7064 - def get_commonality(self): return self.commonality
7065 - def set_commonality(self, commonality): self.commonality = commonality
7069 - def get_volume(self): return self.volume
7070 - def set_volume(self, volume): self.volume = volume
7071 - def add_volume(self, value): self.volume.append(value)
7072 - def insert_volume(self, index, value): self.volume[index] = value
7073 - def get_importance(self): return self.importance
7074 - def set_importance(self, importance): self.importance = importance
7075 - def get_location(self): return self.location
7076 - def set_location(self, location): self.location = location
7077 - def export(self, outfile, level, namespace_='maec:', name_='fieldDataEntry', namespacedef_=''):
7078 showIndent(outfile, level)
7079 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
7080 already_processed = []
7081 self.exportAttributes(outfile, level, already_processed, namespace_, name_='fieldDataEntry')
7082 if self.hasContent_():
7083 outfile.write('>\n')
7084 self.exportChildren(outfile, level + 1, namespace_, name_)
7085 showIndent(outfile, level)
7086 outfile.write('</%s%s>\n' % (namespace_, name_))
7087 else:
7088 outfile.write('/>\n')
7089 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='fieldDataEntry'):
7091 - def exportChildren(self, outfile, level, namespace_='maec:', name_='fieldDataEntry', fromsubclass_=False):
7092 if self.references is not None:
7093 self.references.export(outfile, level, namespace_, name_='references', )
7094 if self.startDate is not None:
7095 showIndent(outfile, level)
7096 outfile.write('<%sstartDate>%s</%sstartDate>\n' % (namespace_, self.gds_format_string(quote_xml(self.startDate).encode(ExternalEncoding), input_name='startDate'), namespace_))
7097 if self.endDate is not None:
7098 showIndent(outfile, level)
7099 outfile.write('<%sendDate>%s</%sendDate>\n' % (namespace_, self.gds_format_string(quote_xml(self.endDate).encode(ExternalEncoding), input_name='endDate'), namespace_))
7100 if self.firstSeenDate is not None:
7101 showIndent(outfile, level)
7102 outfile.write('<%sfirstSeenDate>%s</%sfirstSeenDate>\n' % (namespace_, self.gds_format_string(quote_xml(self.firstSeenDate).encode(ExternalEncoding), input_name='firstSeenDate'), namespace_))
7103 if self.origin is not None:
7104 showIndent(outfile, level)
7105 outfile.write('<%sorigin>%s</%sorigin>\n' % (namespace_, self.gds_format_string(quote_xml(self.origin).encode(ExternalEncoding), input_name='origin'), namespace_))
7106 if self.commonality is not None:
7107 showIndent(outfile, level)
7108 outfile.write('<%scommonality>%s</%scommonality>\n' % (namespace_, self.gds_format_integer(self.commonality, input_name='commonality'), namespace_))
7109 for volume_ in self.volume:
7110 volume_.export(outfile, level, namespace_, name_='volume')
7111 if self.importance is not None:
7112 showIndent(outfile, level)
7113 outfile.write('<%simportance>%s</%simportance>\n' % (namespace_, self.gds_format_integer(self.importance, input_name='importance'), namespace_))
7114 if self.location is not None:
7115 self.location.export(outfile, level, namespace_, name_='location')
7116 - def hasContent_(self):
7117 if (
7118 self.references is not None or
7119 self.startDate is not None or
7120 self.endDate is not None or
7121 self.firstSeenDate is not None or
7122 self.origin is not None or
7123 self.commonality is not None or
7124 self.volume or
7125 self.importance is not None or
7126 self.location is not None
7127 ):
7128 return True
7129 else:
7130 return False
7131 - def exportLiteral(self, outfile, level, name_='fieldDataEntry'):
7132 level += 1
7133 self.exportLiteralAttributes(outfile, level, [], name_)
7134 if self.hasContent_():
7135 self.exportLiteralChildren(outfile, level, name_)
7136 - def exportLiteralAttributes(self, outfile, level, already_processed, name_):
7138 - def exportLiteralChildren(self, outfile, level, name_):
7139 if self.references is not None:
7140 showIndent(outfile, level)
7141 outfile.write('references=model_.referencesType(\n')
7142 self.references.exportLiteral(outfile, level, name_='references')
7143 showIndent(outfile, level)
7144 outfile.write('),\n')
7145 if self.startDate is not None:
7146 showIndent(outfile, level)
7147 outfile.write('startDate=%s,\n' % quote_python(self.startDate).encode(ExternalEncoding))
7148 if self.endDate is not None:
7149 showIndent(outfile, level)
7150 outfile.write('endDate=%s,\n' % quote_python(self.endDate).encode(ExternalEncoding))
7151 if self.firstSeenDate is not None:
7152 showIndent(outfile, level)
7153 outfile.write('firstSeenDate=%s,\n' % quote_python(self.firstSeenDate).encode(ExternalEncoding))
7154 if self.origin is not None:
7155 showIndent(outfile, level)
7156 outfile.write('origin=%s,\n' % quote_python(self.origin).encode(ExternalEncoding))
7157 if self.commonality is not None:
7158 showIndent(outfile, level)
7159 outfile.write('commonality=%d,\n' % self.commonality)
7160 showIndent(outfile, level)
7161 outfile.write('volume=[\n')
7162 level += 1
7163 for volume_ in self.volume:
7164 showIndent(outfile, level)
7165 outfile.write('model_.volumeType(\n')
7166 volume_.exportLiteral(outfile, level, name_='volumeType')
7167 showIndent(outfile, level)
7168 outfile.write('),\n')
7169 level -= 1
7170 showIndent(outfile, level)
7171 outfile.write('],\n')
7172 if self.importance is not None:
7173 showIndent(outfile, level)
7174 outfile.write('importance=%d,\n' % self.importance)
7175 if self.location is not None:
7176 showIndent(outfile, level)
7177 outfile.write('location=model_.locationType(\n')
7178 self.location.exportLiteral(outfile, level, name_='location')
7179 showIndent(outfile, level)
7180 outfile.write('),\n')
7181 - def build(self, node):
7182 self.buildAttributes(node, node.attrib, [])
7183 for child in node:
7184 nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
7185 self.buildChildren(child, node, nodeName_)
7186 - def buildAttributes(self, node, attrs, already_processed):
7188 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
7189 if nodeName_ == 'references':
7190 obj_ = referencesType.factory()
7191 obj_.build(child_)
7192 self.set_references(obj_)
7193 elif nodeName_ == 'startDate':
7194 startDate_ = child_.text
7195 startDate_ = self.gds_validate_string(startDate_, node, 'startDate')
7196 self.startDate = startDate_
7197 elif nodeName_ == 'endDate':
7198 endDate_ = child_.text
7199 endDate_ = self.gds_validate_string(endDate_, node, 'endDate')
7200 self.endDate = endDate_
7201 elif nodeName_ == 'firstSeenDate':
7202 firstSeenDate_ = child_.text
7203 firstSeenDate_ = self.gds_validate_string(firstSeenDate_, node, 'firstSeenDate')
7204 self.firstSeenDate = firstSeenDate_
7205 elif nodeName_ == 'origin':
7206 origin_ = child_.text
7207 origin_ = self.gds_validate_string(origin_, node, 'origin')
7208 self.origin = origin_
7209 self.validate_OriginTypeEnum(self.origin)
7210 elif nodeName_ == 'commonality':
7211 sval_ = child_.text
7212 try:
7213 ival_ = int(sval_)
7214 except (TypeError, ValueError), exp:
7215 raise_parse_error(child_, 'requires integer: %s' % exp)
7216 ival_ = self.gds_validate_integer(ival_, node, 'commonality')
7217 self.commonality = ival_
7218 self.validate_intBetween0and100(self.commonality)
7219 elif nodeName_ == 'volume':
7220 obj_ = volumeType.factory()
7221 obj_.build(child_)
7222 self.volume.append(obj_)
7223 elif nodeName_ == 'importance':
7224 sval_ = child_.text
7225 try:
7226 ival_ = int(sval_)
7227 except (TypeError, ValueError) as e:
7228 raise_parse_error(child_, 'requires integer: %s' % e)
7229 ival_ = self.gds_validate_integer(ival_, node, 'importance')
7230 self.importance = ival_
7231 self.validate_intBetween0and100(self.importance)
7232 elif nodeName_ == 'location':
7233 obj_ = locationType.factory()
7234 obj_.build(child_)
7235 self.set_location(obj_)
7236
7237
7238
7240 """Reference element used to hold xpath expressions to objects, for
7241 example file[@id="12345"]."""
7242 subclass = None
7243 superclass = None
7245 self.valueOf_ = valueOf_
7251 factory = staticmethod(factory)
7253 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
7254 - def export(self, outfile, level, namespace_='maec:', name_='reference', namespacedef_=''):
7255 showIndent(outfile, level)
7256 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
7257 already_processed = []
7258 self.exportAttributes(outfile, level, already_processed, namespace_, name_='reference')
7259 if self.hasContent_():
7260 outfile.write('>')
7261 outfile.write(str(self.valueOf_).encode(ExternalEncoding))
7262 self.exportChildren(outfile, level + 1, namespace_, name_)
7263 outfile.write('</%s%s>\n' % (namespace_, name_))
7264 else:
7265 outfile.write('/>\n')
7266 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='reference'):
7268 - def exportChildren(self, outfile, level, namespace_='maec:', name_='reference', fromsubclass_=False):
7270 - def hasContent_(self):
7271 if (
7272 self.valueOf_
7273 ):
7274 return True
7275 else:
7276 return False
7296 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
7298
7299
7300
7302 """A property."""
7303 subclass = None
7304 superclass = None
7305 - def __init__(self, type_=None, valueOf_=None):
7306 self.type_ = _cast(None, type_)
7307 self.valueOf_ = valueOf_
7313 factory = staticmethod(factory)
7315 - def set_type(self, type_): self.type_ = type_
7320 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
7321 - def export(self, outfile, level, namespace_='maec:', name_='property', namespacedef_=''):
7322 showIndent(outfile, level)
7323 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
7324 already_processed = []
7325 self.exportAttributes(outfile, level, already_processed, namespace_, name_='property')
7326 if self.hasContent_():
7327 outfile.write('>')
7328 outfile.write(str(self.valueOf_).encode(ExternalEncoding))
7329 self.exportChildren(outfile, level + 1, namespace_, name_)
7330 outfile.write('</%s%s>\n' % (namespace_, name_))
7331 else:
7332 outfile.write('/>\n')
7333 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='property'):
7334 if self.type_ is not None and 'type_' not in already_processed:
7335 already_processed.append('type_')
7336 outfile.write(' type=%s' % (quote_attrib(self.type_), ))
7337 - def exportChildren(self, outfile, level, namespace_='maec:', name_='property', fromsubclass_=False):
7339 - def hasContent_(self):
7340 if (
7341 self.valueOf_
7342 ):
7343 return True
7344 else:
7345 return False
7354 if self.type_ is not None and 'type_' not in already_processed:
7355 already_processed.append('type_')
7356 showIndent(outfile, level)
7357 outfile.write('type_ = "%s",\n' % (self.type_,))
7367 value = find_attr_value_('type', node)
7368 if value is not None and 'type' not in already_processed:
7369 already_processed.append('type')
7370 self.type_ = value
7371 self.validate_PropertyTypeEnum(self.type_)
7372 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
7374
7375
7376
7378 """Property; a reference to the object, a timestamp and an unbounded
7379 set of properties. This is used to describe extra information
7380 about an object. For example, to show the url parameter strings
7381 associated with a particular URI object. Or to show file names
7382 associated with a particular file. Properties can also be
7383 applied to relationships, by referencing the relationship by id.
7384 This allows use such as e.g. recording the post data sent in an
7385 http request between a malware (file object) and a uri (uri
7386 object)."""
7387 subclass = None
7388 superclass = None
7389 - def __init__(self, id=None, references=None, timestamp=None, property=None):
7402 factory = staticmethod(factory)
7413 - def export(self, outfile, level, namespace_='maec:', name_='objectProperty', namespacedef_=''):
7414 showIndent(outfile, level)
7415 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
7416 already_processed = []
7417 self.exportAttributes(outfile, level, already_processed, namespace_, name_='objectProperty')
7418 if self.hasContent_():
7419 outfile.write('>\n')
7420 self.exportChildren(outfile, level + 1, namespace_, name_)
7421 showIndent(outfile, level)
7422 outfile.write('</%s%s>\n' % (namespace_, name_))
7423 else:
7424 outfile.write('/>\n')
7425 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='objectProperty'):
7426 if self.id is not None and 'id' not in already_processed:
7427 already_processed.append('id')
7428 outfile.write(' id=%s' % (quote_attrib(self.id), ))
7429 - def exportChildren(self, outfile, level, namespace_='maec:', name_='objectProperty', fromsubclass_=False):
7430 if self.references is not None:
7431 self.references.export(outfile, level, namespace_, name_='references', )
7432 if self.timestamp is not None:
7433 showIndent(outfile, level)
7434 outfile.write('<%stimestamp>%s</%stimestamp>\n' % (namespace_, self.gds_format_string(quote_xml(self.timestamp).encode(ExternalEncoding), input_name='timestamp'), namespace_))
7435 for property_ in self.property:
7436 property_.export(outfile, level, namespace_, name_='property')
7437 - def hasContent_(self):
7438 if (
7439 self.references is not None or
7440 self.timestamp is not None or
7441 self.property
7442 ):
7443 return True
7444 else:
7445 return False
7446 - def exportLiteral(self, outfile, level, name_='objectProperty'):
7452 if self.id is not None and 'id' not in already_processed:
7453 already_processed.append('id')
7454 showIndent(outfile, level)
7455 outfile.write('id = %s,\n' % (self.id,))
7457 if self.references is not None:
7458 showIndent(outfile, level)
7459 outfile.write('references=model_.referencesType1(\n')
7460 self.references.exportLiteral(outfile, level, name_='references')
7461 showIndent(outfile, level)
7462 outfile.write('),\n')
7463 if self.timestamp is not None:
7464 showIndent(outfile, level)
7465 outfile.write('timestamp=%s,\n' % quote_python(self.timestamp).encode(ExternalEncoding))
7466 showIndent(outfile, level)
7467 outfile.write('property=[\n')
7468 level += 1
7469 for property_ in self.property:
7470 showIndent(outfile, level)
7471 outfile.write('model_.property(\n')
7472 property_.exportLiteral(outfile, level)
7473 showIndent(outfile, level)
7474 outfile.write('),\n')
7475 level -= 1
7476 showIndent(outfile, level)
7477 outfile.write('],\n')
7484 value = find_attr_value_('id', node)
7485 if value is not None and 'id' not in already_processed:
7486 already_processed.append('id')
7487 self.id = value
7488 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
7501
7502
7503
7505 """Relationships are used to express relationships between objects, and
7506 dates. Relationships have a type (an attribute with a defined
7507 list of allowed relationships), source (a set of xpath
7508 references to the parent end of the relationship), target (xpath
7509 references to the other end of the relationship) and an optional
7510 date. The linking of objects with types is a powerful way of
7511 describing data. The dates can be used to provide context. For
7512 example, to assign a classification to an object, that can done
7513 with an "isClassifiedAs" relationship, with the date meaning
7514 that that was the data that that classification was assigned. To
7515 show urls and the last visited data, this can be expressed as a
7516 "verifiedBy" relationship between the urls and the entity doing
7517 the verification, with the date interpreted as the verification
7518 date."""
7519 subclass = None
7520 superclass = None
7521 - def __init__(self, type_=None, id=None, source=None, target=None, timestamp=None):
7522 self.type_ = _cast(None, type_)
7523 self.id = _cast(None, id)
7524 self.source = source
7525 self.target = target
7526 self.timestamp = timestamp
7532 factory = staticmethod(factory)
7534 - def set_source(self, source): self.source = source
7540 - def set_type(self, type_): self.type_ = type_
7546 - def export(self, outfile, level, namespace_='maec:', name_='relationship', namespacedef_=''):
7547 showIndent(outfile, level)
7548 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
7549 already_processed = []
7550 self.exportAttributes(outfile, level, already_processed, namespace_, name_='relationship')
7551 if self.hasContent_():
7552 outfile.write('>\n')
7553 self.exportChildren(outfile, level + 1, namespace_, name_)
7554 showIndent(outfile, level)
7555 outfile.write('</%s%s>\n' % (namespace_, name_))
7556 else:
7557 outfile.write('/>\n')
7558 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='relationship'):
7559 if self.type_ is not None and 'type_' not in already_processed:
7560 already_processed.append('type_')
7561 outfile.write(' type=%s' % (quote_attrib(self.type_), ))
7562 if self.id is not None and 'id' not in already_processed:
7563 already_processed.append('id')
7564 outfile.write(' id=%s' % (quote_attrib(self.id), ))
7565 - def exportChildren(self, outfile, level, namespace_='maec:', name_='relationship', fromsubclass_=False):
7566 if self.source is not None:
7567 self.source.export(outfile, level, namespace_, name_='source', )
7568 if self.target is not None:
7569 self.target.export(outfile, level, namespace_, name_='target', )
7570 if self.timestamp is not None:
7571 showIndent(outfile, level)
7572 outfile.write('<%stimestamp>%s</%stimestamp>\n' % (namespace_, self.gds_format_string(quote_xml(self.timestamp).encode(ExternalEncoding), input_name='timestamp'), namespace_))
7573 - def hasContent_(self):
7574 if (
7575 self.source is not None or
7576 self.target is not None or
7577 self.timestamp is not None
7578 ):
7579 return True
7580 else:
7581 return False
7588 if self.type_ is not None and 'type_' not in already_processed:
7589 already_processed.append('type_')
7590 showIndent(outfile, level)
7591 outfile.write('type_ = "%s",\n' % (self.type_,))
7592 if self.id is not None and 'id' not in already_processed:
7593 already_processed.append('id')
7594 showIndent(outfile, level)
7595 outfile.write('id = %s,\n' % (self.id,))
7597 if self.source is not None:
7598 showIndent(outfile, level)
7599 outfile.write('source=model_.sourceType(\n')
7600 self.source.exportLiteral(outfile, level, name_='source')
7601 showIndent(outfile, level)
7602 outfile.write('),\n')
7603 if self.target is not None:
7604 showIndent(outfile, level)
7605 outfile.write('target=model_.targetType(\n')
7606 self.target.exportLiteral(outfile, level, name_='target')
7607 showIndent(outfile, level)
7608 outfile.write('),\n')
7609 if self.timestamp is not None:
7610 showIndent(outfile, level)
7611 outfile.write('timestamp=%s,\n' % quote_python(self.timestamp).encode(ExternalEncoding))
7618 value = find_attr_value_('type', node)
7619 if value is not None and 'type' not in already_processed:
7620 already_processed.append('type')
7621 self.type_ = value
7622 self.validate_RelationshipTypeEnum(self.type_)
7623 value = find_attr_value_('id', node)
7624 if value is not None and 'id' not in already_processed:
7625 already_processed.append('id')
7626 self.id = value
7627 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
7640
7641
7642
7644 subclass = None
7645 superclass = None
7647 if Analysis is None:
7648 self.Analysis = []
7649 else:
7650 self.Analysis = Analysis
7656 factory = staticmethod(factory)
7658 - def set_Analysis(self, Analysis): self.Analysis = Analysis
7659 - def add_Analysis(self, value): self.Analysis.append(value)
7661 - def export(self, outfile, level, namespace_='maec:', name_='AnalysesType', namespacedef_=''):
7662 showIndent(outfile, level)
7663 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
7664 already_processed = []
7665 self.exportAttributes(outfile, level, already_processed, namespace_, name_='AnalysesType')
7666 if self.hasContent_():
7667 outfile.write('>\n')
7668 self.exportChildren(outfile, level + 1, namespace_, name_)
7669 showIndent(outfile, level)
7670 outfile.write('</%s%s>\n' % (namespace_, name_))
7671 else:
7672 outfile.write('/>\n')
7673 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='AnalysesType'):
7675 - def exportChildren(self, outfile, level, namespace_='maec:', name_='AnalysesType', fromsubclass_=False):
7676 for Analysis_ in self.Analysis:
7677 Analysis_.export(outfile, level, namespace_, name_='Analysis')
7678 - def hasContent_(self):
7679 if (
7680 self.Analysis
7681 ):
7682 return True
7683 else:
7684 return False
7693 showIndent(outfile, level)
7694 outfile.write('Analysis=[\n')
7695 level += 1
7696 for Analysis_ in self.Analysis:
7697 showIndent(outfile, level)
7698 outfile.write('model_.AnalysisType(\n')
7699 Analysis_.exportLiteral(outfile, level, name_='AnalysisType')
7700 showIndent(outfile, level)
7701 outfile.write('),\n')
7702 level -= 1
7703 showIndent(outfile, level)
7704 outfile.write('],\n')
7712 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
7713 if nodeName_ == 'Analysis':
7714 obj_ = AnalysisType.factory()
7715 obj_.build(child_)
7716 self.Analysis.append(obj_)
7717
7718
7719
7721 subclass = None
7722 superclass = None
7724 if Behavior is None:
7725 self.Behavior = []
7726 else:
7727 self.Behavior = Behavior
7733 factory = staticmethod(factory)
7735 - def set_Behavior(self, Behavior): self.Behavior = Behavior
7736 - def add_Behavior(self, value): self.Behavior.append(value)
7738 - def export(self, outfile, level, namespace_='maec:', name_='BehaviorsType', namespacedef_=''):
7739 showIndent(outfile, level)
7740 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
7741 already_processed = []
7742 self.exportAttributes(outfile, level, already_processed, namespace_, name_='BehaviorsType')
7743 if self.hasContent_():
7744 outfile.write('>\n')
7745 self.exportChildren(outfile, level + 1, namespace_, name_)
7746 showIndent(outfile, level)
7747 outfile.write('</%s%s>\n' % (namespace_, name_))
7748 else:
7749 outfile.write('/>\n')
7750 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='BehaviorsType'):
7752 - def exportChildren(self, outfile, level, namespace_='maec:', name_='BehaviorsType', fromsubclass_=False):
7753 for Behavior_ in self.Behavior:
7754 Behavior_.export(outfile, level, namespace_, name_='Behavior')
7755 - def hasContent_(self):
7756 if (
7757 self.Behavior
7758 ):
7759 return True
7760 else:
7761 return False
7762 - def exportLiteral(self, outfile, level, name_='BehaviorsType'):
7770 showIndent(outfile, level)
7771 outfile.write('Behavior=[\n')
7772 level += 1
7773 for Behavior_ in self.Behavior:
7774 showIndent(outfile, level)
7775 outfile.write('model_.BehaviorType(\n')
7776 Behavior_.exportLiteral(outfile, level, name_='BehaviorType')
7777 showIndent(outfile, level)
7778 outfile.write('),\n')
7779 level -= 1
7780 showIndent(outfile, level)
7781 outfile.write('],\n')
7789 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
7790 if nodeName_ == 'Behavior':
7791 obj_ = BehaviorType.factory()
7792 obj_.build(child_)
7793 self.Behavior.append(obj_)
7794
7795
7796
7798 subclass = None
7799 superclass = None
7801 if Action is None:
7802 self.Action = []
7803 else:
7804 self.Action = Action
7810 factory = staticmethod(factory)
7812 - def set_Action(self, Action): self.Action = Action
7813 - def add_Action(self, value): self.Action.append(value)
7814 - def insert_Action(self, index, value): self.Action[index] = value
7815 - def export(self, outfile, level, namespace_='maec:', name_='ActionsType', namespacedef_=''):
7816 showIndent(outfile, level)
7817 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
7818 already_processed = []
7819 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ActionsType')
7820 if self.hasContent_():
7821 outfile.write('>\n')
7822 self.exportChildren(outfile, level + 1, namespace_, name_)
7823 showIndent(outfile, level)
7824 outfile.write('</%s%s>\n' % (namespace_, name_))
7825 else:
7826 outfile.write('/>\n')
7827 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ActionsType'):
7829 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ActionsType', fromsubclass_=False):
7830 for Action_ in self.Action:
7831 Action_.export(outfile, level, namespace_, name_='Action')
7832 - def hasContent_(self):
7833 if (
7834 self.Action
7835 ):
7836 return True
7837 else:
7838 return False
7847 showIndent(outfile, level)
7848 outfile.write('Action=[\n')
7849 level += 1
7850 for Action_ in self.Action:
7851 showIndent(outfile, level)
7852 outfile.write('model_.ActionType(\n')
7853 Action_.exportLiteral(outfile, level, name_='ActionType')
7854 showIndent(outfile, level)
7855 outfile.write('),\n')
7856 level -= 1
7857 showIndent(outfile, level)
7858 outfile.write('],\n')
7866 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
7867 if nodeName_ == 'Action':
7868 obj_ = ActionType.factory()
7869 obj_.build(child_)
7870 self.Action.append(obj_)
7871
7872
7873
7875 subclass = None
7876 superclass = None
7877 - def __init__(self, Behavior_Collection_Pool=None, Behavior_Pool=None, Action_Collection_Pool=None, Action_Pool=None, Object_Pool=None, Effect_Pool=None, Object_Collection_Pool=None):
7878 self.Behavior_Collection_Pool = Behavior_Collection_Pool
7879 self.Behavior_Pool = Behavior_Pool
7880 self.Action_Collection_Pool = Action_Collection_Pool
7881 self.Action_Pool = Action_Pool
7882 self.Object_Pool = Object_Pool
7883 self.Effect_Pool = Effect_Pool
7884 self.Object_Collection_Pool = Object_Collection_Pool
7890 factory = staticmethod(factory)
7905 - def export(self, outfile, level, namespace_='maec:', name_='PoolsType', namespacedef_=''):
7906 showIndent(outfile, level)
7907 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
7908 already_processed = []
7909 self.exportAttributes(outfile, level, already_processed, namespace_, name_='PoolsType')
7910 if self.hasContent_():
7911 outfile.write('>\n')
7912 self.exportChildren(outfile, level + 1, namespace_, name_)
7913 showIndent(outfile, level)
7914 outfile.write('</%s%s>\n' % (namespace_, name_))
7915 else:
7916 outfile.write('/>\n')
7917 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='PoolsType'):
7919 - def exportChildren(self, outfile, level, namespace_='maec:', name_='PoolsType', fromsubclass_=False):
7920 if self.Behavior_Collection_Pool is not None:
7921 self.Behavior_Collection_Pool.export(outfile, level, namespace_, name_='Behavior_Collection_Pool')
7922 if self.Behavior_Pool is not None:
7923 self.Behavior_Pool.export(outfile, level, namespace_, name_='Behavior_Pool')
7924 if self.Action_Collection_Pool is not None:
7925 self.Action_Collection_Pool.export(outfile, level, namespace_, name_='Action_Collection_Pool')
7926 if self.Action_Pool is not None:
7927 self.Action_Pool.export(outfile, level, namespace_, name_='Action_Pool')
7928 if self.Object_Pool is not None:
7929 self.Object_Pool.export(outfile, level, namespace_, name_='Object_Pool')
7930 if self.Effect_Pool is not None:
7931 self.Effect_Pool.export(outfile, level, namespace_, name_='Effect_Pool')
7932 if self.Object_Collection_Pool is not None:
7933 self.Object_Collection_Pool.export(outfile, level, namespace_, name_='Object_Collection_Pool')
7934 - def hasContent_(self):
7935 if (
7936 self.Behavior_Collection_Pool is not None or
7937 self.Behavior_Pool is not None or
7938 self.Action_Collection_Pool is not None or
7939 self.Action_Pool is not None or
7940 self.Object_Pool is not None or
7941 self.Effect_Pool is not None or
7942 self.Object_Collection_Pool is not None
7943 ):
7944 return True
7945 else:
7946 return False
7955 if self.Behavior_Collection_Pool is not None:
7956 showIndent(outfile, level)
7957 outfile.write('Behavior_Collection_Pool=model_.Behavior_Collection_PoolType(\n')
7958 self.Behavior_Collection_Pool.exportLiteral(outfile, level, name_='Behavior_Collection_Pool')
7959 showIndent(outfile, level)
7960 outfile.write('),\n')
7961 if self.Behavior_Pool is not None:
7962 showIndent(outfile, level)
7963 outfile.write('Behavior_Pool=model_.Behavior_PoolType(\n')
7964 self.Behavior_Pool.exportLiteral(outfile, level, name_='Behavior_Pool')
7965 showIndent(outfile, level)
7966 outfile.write('),\n')
7967 if self.Action_Collection_Pool is not None:
7968 showIndent(outfile, level)
7969 outfile.write('Action_Collection_Pool=model_.Action_Collection_PoolType(\n')
7970 self.Action_Collection_Pool.exportLiteral(outfile, level, name_='Action_Collection_Pool')
7971 showIndent(outfile, level)
7972 outfile.write('),\n')
7973 if self.Action_Pool is not None:
7974 showIndent(outfile, level)
7975 outfile.write('Action_Pool=model_.Action_PoolType(\n')
7976 self.Action_Pool.exportLiteral(outfile, level, name_='Action_Pool')
7977 showIndent(outfile, level)
7978 outfile.write('),\n')
7979 if self.Object_Pool is not None:
7980 showIndent(outfile, level)
7981 outfile.write('Object_Pool=model_.Object_PoolType(\n')
7982 self.Object_Pool.exportLiteral(outfile, level, name_='Object_Pool')
7983 showIndent(outfile, level)
7984 outfile.write('),\n')
7985 if self.Effect_Pool is not None:
7986 showIndent(outfile, level)
7987 outfile.write('Effect_Pool=model_.Effect_PoolType(\n')
7988 self.Effect_Pool.exportLiteral(outfile, level, name_='Effect_Pool')
7989 showIndent(outfile, level)
7990 outfile.write('),\n')
7991 if self.Object_Collection_Pool is not None:
7992 showIndent(outfile, level)
7993 outfile.write('Object_Collection_Pool=model_.Object_Collection_PoolType(\n')
7994 self.Object_Collection_Pool.exportLiteral(outfile, level, name_='Object_Collection_Pool')
7995 showIndent(outfile, level)
7996 outfile.write('),\n')
8004 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
8033
8034
8035
8037 subclass = None
8038 superclass = None
8039 - def __init__(self, Behavior_Collection=None):
8040 if Behavior_Collection is None:
8041 self.Behavior_Collection = []
8042 else:
8043 self.Behavior_Collection = Behavior_Collection
8049 factory = staticmethod(factory)
8054 - def export(self, outfile, level, namespace_='maec:', name_='Behavior_Collection_PoolType', namespacedef_=''):
8055 showIndent(outfile, level)
8056 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
8057 already_processed = []
8058 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Behavior_Collection_PoolType')
8059 if self.hasContent_():
8060 outfile.write('>\n')
8061 self.exportChildren(outfile, level + 1, namespace_, name_)
8062 showIndent(outfile, level)
8063 outfile.write('</%s%s>\n' % (namespace_, name_))
8064 else:
8065 outfile.write('/>\n')
8066 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Behavior_Collection_PoolType'):
8068 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Behavior_Collection_PoolType', fromsubclass_=False):
8069 for Behavior_Collection_ in self.Behavior_Collection:
8070 Behavior_Collection_.export(outfile, level, namespace_, name_='Behavior_Collection')
8071 - def hasContent_(self):
8072 if (
8073 self.Behavior_Collection
8074 ):
8075 return True
8076 else:
8077 return False
8078 - def exportLiteral(self, outfile, level, name_='Behavior_Collection_PoolType'):
8086 showIndent(outfile, level)
8087 outfile.write('Behavior_Collection=[\n')
8088 level += 1
8089 for Behavior_Collection_ in self.Behavior_Collection:
8090 showIndent(outfile, level)
8091 outfile.write('model_.BehaviorCollectionType(\n')
8092 Behavior_Collection_.exportLiteral(outfile, level, name_='BehaviorCollectionType')
8093 showIndent(outfile, level)
8094 outfile.write('),\n')
8095 level -= 1
8096 showIndent(outfile, level)
8097 outfile.write('],\n')
8105 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
8110
8111
8112
8114 subclass = None
8115 superclass = None
8117 if Behavior is None:
8118 self.Behavior = []
8119 else:
8120 self.Behavior = Behavior
8126 factory = staticmethod(factory)
8128 - def set_Behavior(self, Behavior): self.Behavior = Behavior
8129 - def add_Behavior(self, value): self.Behavior.append(value)
8131 - def export(self, outfile, level, namespace_='maec:', name_='Behavior_PoolType', namespacedef_=''):
8132 showIndent(outfile, level)
8133 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
8134 already_processed = []
8135 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Behavior_PoolType')
8136 if self.hasContent_():
8137 outfile.write('>\n')
8138 self.exportChildren(outfile, level + 1, namespace_, name_)
8139 showIndent(outfile, level)
8140 outfile.write('</%s%s>\n' % (namespace_, name_))
8141 else:
8142 outfile.write('/>\n')
8143 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Behavior_PoolType'):
8145 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Behavior_PoolType', fromsubclass_=False):
8146 for Behavior_ in self.Behavior:
8147 Behavior_.export(outfile, level, namespace_, name_='Behavior')
8148 - def hasContent_(self):
8149 if (
8150 self.Behavior
8151 ):
8152 return True
8153 else:
8154 return False
8155 - def exportLiteral(self, outfile, level, name_='Behavior_PoolType'):
8163 showIndent(outfile, level)
8164 outfile.write('Behavior=[\n')
8165 level += 1
8166 for Behavior_ in self.Behavior:
8167 showIndent(outfile, level)
8168 outfile.write('model_.BehaviorType(\n')
8169 Behavior_.exportLiteral(outfile, level, name_='BehaviorType')
8170 showIndent(outfile, level)
8171 outfile.write('),\n')
8172 level -= 1
8173 showIndent(outfile, level)
8174 outfile.write('],\n')
8182 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
8183 if nodeName_ == 'Behavior':
8184 obj_ = BehaviorType.factory()
8185 obj_.build(child_)
8186 self.Behavior.append(obj_)
8187
8188
8189
8191 subclass = None
8192 superclass = None
8193 - def __init__(self, Action_Collection=None):
8194 if Action_Collection is None:
8195 self.Action_Collection = []
8196 else:
8197 self.Action_Collection = Action_Collection
8203 factory = staticmethod(factory)
8208 - def export(self, outfile, level, namespace_='maec:', name_='Action_Collection_PoolType', namespacedef_=''):
8209 showIndent(outfile, level)
8210 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
8211 already_processed = []
8212 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Action_Collection_PoolType')
8213 if self.hasContent_():
8214 outfile.write('>\n')
8215 self.exportChildren(outfile, level + 1, namespace_, name_)
8216 showIndent(outfile, level)
8217 outfile.write('</%s%s>\n' % (namespace_, name_))
8218 else:
8219 outfile.write('/>\n')
8220 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Action_Collection_PoolType'):
8222 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Action_Collection_PoolType', fromsubclass_=False):
8223 for Action_Collection_ in self.Action_Collection:
8224 Action_Collection_.export(outfile, level, namespace_, name_='Action_Collection')
8225 - def hasContent_(self):
8226 if (
8227 self.Action_Collection
8228 ):
8229 return True
8230 else:
8231 return False
8232 - def exportLiteral(self, outfile, level, name_='Action_Collection_PoolType'):
8240 showIndent(outfile, level)
8241 outfile.write('Action_Collection=[\n')
8242 level += 1
8243 for Action_Collection_ in self.Action_Collection:
8244 showIndent(outfile, level)
8245 outfile.write('model_.ActionCollectionType(\n')
8246 Action_Collection_.exportLiteral(outfile, level, name_='ActionCollectionType')
8247 showIndent(outfile, level)
8248 outfile.write('),\n')
8249 level -= 1
8250 showIndent(outfile, level)
8251 outfile.write('],\n')
8259 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
8264
8265
8266
8268 subclass = None
8269 superclass = None
8271 if Action is None:
8272 self.Action = []
8273 else:
8274 self.Action = Action
8280 factory = staticmethod(factory)
8282 - def set_Action(self, Action): self.Action = Action
8283 - def add_Action(self, value): self.Action.append(value)
8284 - def insert_Action(self, index, value): self.Action[index] = value
8285 - def export(self, outfile, level, namespace_='maec:', name_='Action_PoolType', namespacedef_=''):
8286 showIndent(outfile, level)
8287 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
8288 already_processed = []
8289 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Action_PoolType')
8290 if self.hasContent_():
8291 outfile.write('>\n')
8292 self.exportChildren(outfile, level + 1, namespace_, name_)
8293 showIndent(outfile, level)
8294 outfile.write('</%s%s>\n' % (namespace_, name_))
8295 else:
8296 outfile.write('/>\n')
8297 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Action_PoolType'):
8299 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Action_PoolType', fromsubclass_=False):
8300 for Action_ in self.Action:
8301 Action_.export(outfile, level, namespace_, name_='Action')
8302 - def hasContent_(self):
8303 if (
8304 self.Action
8305 ):
8306 return True
8307 else:
8308 return False
8309 - def exportLiteral(self, outfile, level, name_='Action_PoolType'):
8317 showIndent(outfile, level)
8318 outfile.write('Action=[\n')
8319 level += 1
8320 for Action_ in self.Action:
8321 showIndent(outfile, level)
8322 outfile.write('model_.ActionType(\n')
8323 Action_.exportLiteral(outfile, level, name_='ActionType')
8324 showIndent(outfile, level)
8325 outfile.write('),\n')
8326 level -= 1
8327 showIndent(outfile, level)
8328 outfile.write('],\n')
8336 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
8337 if nodeName_ == 'Action':
8338 obj_ = ActionType.factory()
8339 obj_.build(child_)
8340 self.Action.append(obj_)
8341
8342
8343
8345 subclass = None
8346 superclass = None
8348 if Object is None:
8349 self.Object = []
8350 else:
8351 self.Object = Object
8357 factory = staticmethod(factory)
8359 - def set_Object(self, Object): self.Object = Object
8360 - def add_Object(self, value): self.Object.append(value)
8361 - def insert_Object(self, index, value): self.Object[index] = value
8362 - def export(self, outfile, level, namespace_='maec:', name_='Object_PoolType', namespacedef_=''):
8363 showIndent(outfile, level)
8364 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
8365 already_processed = []
8366 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Object_PoolType')
8367 if self.hasContent_():
8368 outfile.write('>\n')
8369 self.exportChildren(outfile, level + 1, namespace_, name_)
8370 showIndent(outfile, level)
8371 outfile.write('</%s%s>\n' % (namespace_, name_))
8372 else:
8373 outfile.write('/>\n')
8374 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Object_PoolType'):
8376 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Object_PoolType', fromsubclass_=False):
8377 for Object_ in self.Object:
8378 Object_.export(outfile, level, namespace_, name_='Object')
8379 - def hasContent_(self):
8380 if (
8381 self.Object
8382 ):
8383 return True
8384 else:
8385 return False
8386 - def exportLiteral(self, outfile, level, name_='Object_PoolType'):
8394 showIndent(outfile, level)
8395 outfile.write('Object=[\n')
8396 level += 1
8397 for Object_ in self.Object:
8398 showIndent(outfile, level)
8399 outfile.write('model_.ObjectType(\n')
8400 Object_.exportLiteral(outfile, level, name_='ObjectType')
8401 showIndent(outfile, level)
8402 outfile.write('),\n')
8403 level -= 1
8404 showIndent(outfile, level)
8405 outfile.write('],\n')
8413 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
8414 if nodeName_ == 'Object':
8415 obj_ = ObjectType.factory()
8416 obj_.build(child_)
8417 self.Object.append(obj_)
8418
8419
8420
8422 subclass = None
8423 superclass = None
8425 if Effect is None:
8426 self.Effect = []
8427 else:
8428 self.Effect = Effect
8434 factory = staticmethod(factory)
8436 - def set_Effect(self, Effect): self.Effect = Effect
8437 - def add_Effect(self, value): self.Effect.append(value)
8438 - def insert_Effect(self, index, value): self.Effect[index] = value
8439 - def export(self, outfile, level, namespace_='maec:', name_='Effect_PoolType', namespacedef_=''):
8440 showIndent(outfile, level)
8441 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
8442 already_processed = []
8443 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Effect_PoolType')
8444 if self.hasContent_():
8445 outfile.write('>\n')
8446 self.exportChildren(outfile, level + 1, namespace_, name_)
8447 showIndent(outfile, level)
8448 outfile.write('</%s%s>\n' % (namespace_, name_))
8449 else:
8450 outfile.write('/>\n')
8451 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Effect_PoolType'):
8453 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Effect_PoolType', fromsubclass_=False):
8454 for Effect_ in self.Effect:
8455 Effect_.export(outfile, level, namespace_, name_='Effect')
8456 - def hasContent_(self):
8457 if (
8458 self.Effect
8459 ):
8460 return True
8461 else:
8462 return False
8463 - def exportLiteral(self, outfile, level, name_='Effect_PoolType'):
8471 showIndent(outfile, level)
8472 outfile.write('Effect=[\n')
8473 level += 1
8474 for Effect_ in self.Effect:
8475 showIndent(outfile, level)
8476 outfile.write('model_.EffectType(\n')
8477 Effect_.exportLiteral(outfile, level, name_='EffectType')
8478 showIndent(outfile, level)
8479 outfile.write('),\n')
8480 level -= 1
8481 showIndent(outfile, level)
8482 outfile.write('],\n')
8490 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
8491 if nodeName_ == 'Effect':
8492 obj_ = EffectType.factory()
8493 obj_.build(child_)
8494 self.Effect.append(obj_)
8495
8496
8497
8499 subclass = None
8500 superclass = None
8501 - def __init__(self, Object_Collection=None):
8502 if Object_Collection is None:
8503 self.Object_Collection = []
8504 else:
8505 self.Object_Collection = Object_Collection
8511 factory = staticmethod(factory)
8516 - def export(self, outfile, level, namespace_='maec:', name_='Object_Collection_PoolType', namespacedef_=''):
8517 showIndent(outfile, level)
8518 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
8519 already_processed = []
8520 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Object_Collection_PoolType')
8521 if self.hasContent_():
8522 outfile.write('>\n')
8523 self.exportChildren(outfile, level + 1, namespace_, name_)
8524 showIndent(outfile, level)
8525 outfile.write('</%s%s>\n' % (namespace_, name_))
8526 else:
8527 outfile.write('/>\n')
8528 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Object_Collection_PoolType'):
8530 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Object_Collection_PoolType', fromsubclass_=False):
8531 for Object_Collection_ in self.Object_Collection:
8532 Object_Collection_.export(outfile, level, namespace_, name_='Object_Collection')
8533 - def hasContent_(self):
8534 if (
8535 self.Object_Collection
8536 ):
8537 return True
8538 else:
8539 return False
8540 - def exportLiteral(self, outfile, level, name_='Object_Collection_PoolType'):
8548 showIndent(outfile, level)
8549 outfile.write('Object_Collection=[\n')
8550 level += 1
8551 for Object_Collection_ in self.Object_Collection:
8552 showIndent(outfile, level)
8553 outfile.write('model_.ObjectCollectionType(\n')
8554 Object_Collection_.exportLiteral(outfile, level, name_='ObjectCollectionType')
8555 showIndent(outfile, level)
8556 outfile.write('),\n')
8557 level -= 1
8558 showIndent(outfile, level)
8559 outfile.write('],\n')
8567 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
8572
8573
8574
8576 subclass = None
8577 superclass = None
8579 if Effect is None:
8580 self.Effect = []
8581 else:
8582 self.Effect = Effect
8588 factory = staticmethod(factory)
8590 - def set_Effect(self, Effect): self.Effect = Effect
8591 - def add_Effect(self, value): self.Effect.append(value)
8592 - def insert_Effect(self, index, value): self.Effect[index] = value
8593 - def export(self, outfile, level, namespace_='maec:', name_='EffectsType', namespacedef_=''):
8594 showIndent(outfile, level)
8595 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
8596 already_processed = []
8597 self.exportAttributes(outfile, level, already_processed, namespace_, name_='EffectsType')
8598 if self.hasContent_():
8599 outfile.write('>\n')
8600 self.exportChildren(outfile, level + 1, namespace_, name_)
8601 showIndent(outfile, level)
8602 outfile.write('</%s%s>\n' % (namespace_, name_))
8603 else:
8604 outfile.write('/>\n')
8605 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='EffectsType'):
8607 - def exportChildren(self, outfile, level, namespace_='maec:', name_='EffectsType', fromsubclass_=False):
8608 for Effect_ in self.Effect:
8609 Effect_.export(outfile, level, namespace_, name_='Effect')
8610 - def hasContent_(self):
8611 if (
8612 self.Effect
8613 ):
8614 return True
8615 else:
8616 return False
8625 showIndent(outfile, level)
8626 outfile.write('Effect=[\n')
8627 level += 1
8628 for Effect_ in self.Effect:
8629 showIndent(outfile, level)
8630 outfile.write('model_.EffectType(\n')
8631 Effect_.exportLiteral(outfile, level, name_='EffectType')
8632 showIndent(outfile, level)
8633 outfile.write('),\n')
8634 level -= 1
8635 showIndent(outfile, level)
8636 outfile.write('],\n')
8644 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
8645 if nodeName_ == 'Effect':
8646 obj_ = EffectType.factory()
8647 obj_.build(child_)
8648 self.Effect.append(obj_)
8649
8650
8651
8653 subclass = None
8654 superclass = None
8655 - def __init__(self, Description=None, Attempted_Vulnerability_Exploit=None):
8656 self.Description = Description
8657 self.Attempted_Vulnerability_Exploit = Attempted_Vulnerability_Exploit
8663 factory = staticmethod(factory)
8668 - def export(self, outfile, level, namespace_='maec:', name_='PurposeType', namespacedef_=''):
8669 showIndent(outfile, level)
8670 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
8671 already_processed = []
8672 self.exportAttributes(outfile, level, already_processed, namespace_, name_='PurposeType')
8673 if self.hasContent_():
8674 outfile.write('>\n')
8675 self.exportChildren(outfile, level + 1, namespace_, name_)
8676 showIndent(outfile, level)
8677 outfile.write('</%s%s>\n' % (namespace_, name_))
8678 else:
8679 outfile.write('/>\n')
8680 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='PurposeType'):
8682 - def exportChildren(self, outfile, level, namespace_='maec:', name_='PurposeType', fromsubclass_=False):
8683 if self.Description is not None:
8684 self.Description.export(outfile, level, namespace_, name_='Description')
8685 if self.Attempted_Vulnerability_Exploit is not None:
8686 self.Attempted_Vulnerability_Exploit.export(outfile, level, namespace_, name_='Attempted_Vulnerability_Exploit')
8687 - def hasContent_(self):
8688 if (
8689 self.Description is not None or
8690 self.Attempted_Vulnerability_Exploit is not None
8691 ):
8692 return True
8693 else:
8694 return False
8703 if self.Description is not None:
8704 showIndent(outfile, level)
8705 outfile.write('Description=model_.StructuredTextType(\n')
8706 self.Description.exportLiteral(outfile, level, name_='Description')
8707 showIndent(outfile, level)
8708 outfile.write('),\n')
8709 if self.Attempted_Vulnerability_Exploit is not None:
8710 showIndent(outfile, level)
8711 outfile.write('Attempted_Vulnerability_Exploit=model_.Attempted_Vulnerability_ExploitType(\n')
8712 self.Attempted_Vulnerability_Exploit.exportLiteral(outfile, level, name_='Attempted_Vulnerability_Exploit')
8713 showIndent(outfile, level)
8714 outfile.write('),\n')
8722 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
8731
8732
8733
8735 """This field refers to whether the vulnerability that is being
8736 exploited is known or unknown. Only known vulnerabilities will
8737 have an associated CPE identifier. Possible values: Known,
8738 Unknown."""
8739 subclass = None
8740 superclass = None
8741 - def __init__(self, vulnerability_type=None, Known_Exploit=None):
8742 self.vulnerability_type = _cast(None, vulnerability_type)
8743 self.Known_Exploit = Known_Exploit
8749 factory = staticmethod(factory)
8754 - def export(self, outfile, level, namespace_='maec:', name_='Attempted_Vulnerability_ExploitType', namespacedef_=''):
8755 showIndent(outfile, level)
8756 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
8757 already_processed = []
8758 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Attempted_Vulnerability_ExploitType')
8759 if self.hasContent_():
8760 outfile.write('>\n')
8761 self.exportChildren(outfile, level + 1, namespace_, name_)
8762 showIndent(outfile, level)
8763 outfile.write('</%s%s>\n' % (namespace_, name_))
8764 else:
8765 outfile.write('/>\n')
8766 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Attempted_Vulnerability_ExploitType'):
8767 if self.vulnerability_type is not None and 'vulnerability_type' not in already_processed:
8768 already_processed.append('vulnerability_type')
8769 outfile.write(' vulnerability_type=%s' % (self.gds_format_string(quote_attrib(self.vulnerability_type).encode(ExternalEncoding), input_name='vulnerability_type'), ))
8770 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Attempted_Vulnerability_ExploitType', fromsubclass_=False):
8771 if self.Known_Exploit is not None:
8772 self.Known_Exploit.export(outfile, level, namespace_, name_='Known_Exploit', )
8773 - def hasContent_(self):
8774 if (
8775 self.Known_Exploit is not None
8776 ):
8777 return True
8778 else:
8779 return False
8780 - def exportLiteral(self, outfile, level, name_='Attempted_Vulnerability_ExploitType'):
8786 if self.vulnerability_type is not None and 'vulnerability_type' not in already_processed:
8787 already_processed.append('vulnerability_type')
8788 showIndent(outfile, level)
8789 outfile.write('vulnerability_type = "%s",\n' % (self.vulnerability_type,))
8791 if self.Known_Exploit is not None:
8792 showIndent(outfile, level)
8793 outfile.write('Known_Exploit=model_.CVEVulnerabilityType(\n')
8794 self.Known_Exploit.exportLiteral(outfile, level, name_='Known_Exploit')
8795 showIndent(outfile, level)
8796 outfile.write('),\n')
8803 value = find_attr_value_('vulnerability_type', node)
8804 if value is not None and 'vulnerability_type' not in already_processed:
8805 already_processed.append('vulnerability_type')
8806 self.vulnerability_type = value
8807 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
8812
8813
8814
8816 subclass = None
8817 superclass = None
8818 - def __init__(self, Action_Collection=None, Action=None, Action_Reference=None):
8819 if Action_Collection is None:
8820 self.Action_Collection = []
8821 else:
8822 self.Action_Collection = Action_Collection
8823 if Action is None:
8824 self.Action = []
8825 else:
8826 self.Action = Action
8827 if Action_Reference is None:
8828 self.Action_Reference = []
8829 else:
8830 self.Action_Reference = Action_Reference
8836 factory = staticmethod(factory)
8842 - def set_Action(self, Action): self.Action = Action
8843 - def add_Action(self, value): self.Action.append(value)
8844 - def insert_Action(self, index, value): self.Action[index] = value
8849 - def export(self, outfile, level, namespace_='maec:', name_='ActionsType1', namespacedef_=''):
8850 showIndent(outfile, level)
8851 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
8852 already_processed = []
8853 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ActionsType1')
8854 if self.hasContent_():
8855 outfile.write('>\n')
8856 self.exportChildren(outfile, level + 1, namespace_, name_)
8857 showIndent(outfile, level)
8858 outfile.write('</%s%s>\n' % (namespace_, name_))
8859 else:
8860 outfile.write('/>\n')
8861 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ActionsType1'):
8863 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ActionsType1', fromsubclass_=False):
8864 for Action_Collection_ in self.Action_Collection:
8865 Action_Collection_.export(outfile, level, namespace_, name_='Action_Collection')
8866 for Action_ in self.Action:
8867 Action_.export(outfile, level, namespace_, name_='Action')
8868 for Action_Reference_ in self.Action_Reference:
8869 Action_Reference_.export(outfile, level, namespace_, name_='Action_Reference')
8870 - def hasContent_(self):
8871 if (
8872 self.Action_Collection or
8873 self.Action or
8874 self.Action_Reference
8875 ):
8876 return True
8877 else:
8878 return False
8887 showIndent(outfile, level)
8888 outfile.write('Action_Collection=[\n')
8889 level += 1
8890 for Action_Collection_ in self.Action_Collection:
8891 showIndent(outfile, level)
8892 outfile.write('model_.ActionCollectionType(\n')
8893 Action_Collection_.exportLiteral(outfile, level, name_='ActionCollectionType')
8894 showIndent(outfile, level)
8895 outfile.write('),\n')
8896 level -= 1
8897 showIndent(outfile, level)
8898 outfile.write('],\n')
8899 showIndent(outfile, level)
8900 outfile.write('Action=[\n')
8901 level += 1
8902 for Action_ in self.Action:
8903 showIndent(outfile, level)
8904 outfile.write('model_.ActionType(\n')
8905 Action_.exportLiteral(outfile, level, name_='ActionType')
8906 showIndent(outfile, level)
8907 outfile.write('),\n')
8908 level -= 1
8909 showIndent(outfile, level)
8910 outfile.write('],\n')
8911 showIndent(outfile, level)
8912 outfile.write('Action_Reference=[\n')
8913 level += 1
8914 for Action_Reference_ in self.Action_Reference:
8915 showIndent(outfile, level)
8916 outfile.write('model_.ActionReferenceType(\n')
8917 Action_Reference_.exportLiteral(outfile, level, name_='ActionReferenceType')
8918 showIndent(outfile, level)
8919 outfile.write('),\n')
8920 level -= 1
8921 showIndent(outfile, level)
8922 outfile.write('],\n')
8930 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
8943
8944
8945
8947 subclass = None
8948 superclass = None
8949 - def __init__(self, Object_Reference=None, Object=None):
8950 if Object_Reference is None:
8951 self.Object_Reference = []
8952 else:
8953 self.Object_Reference = Object_Reference
8954 if Object is None:
8955 self.Object = []
8956 else:
8957 self.Object = Object
8963 factory = staticmethod(factory)
8969 - def set_Object(self, Object): self.Object = Object
8970 - def add_Object(self, value): self.Object.append(value)
8971 - def insert_Object(self, index, value): self.Object[index] = value
8972 - def export(self, outfile, level, namespace_='maec:', name_='ObjectsType', namespacedef_=''):
8973 showIndent(outfile, level)
8974 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
8975 already_processed = []
8976 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ObjectsType')
8977 if self.hasContent_():
8978 outfile.write('>\n')
8979 self.exportChildren(outfile, level + 1, namespace_, name_)
8980 showIndent(outfile, level)
8981 outfile.write('</%s%s>\n' % (namespace_, name_))
8982 else:
8983 outfile.write('/>\n')
8984 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ObjectsType'):
8986 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ObjectsType', fromsubclass_=False):
8987 for Object_Reference_ in self.Object_Reference:
8988 Object_Reference_.export(outfile, level, namespace_, name_='Object_Reference')
8989 for Object_ in self.Object:
8990 Object_.export(outfile, level, namespace_, name_='Object')
8991 - def hasContent_(self):
8992 if (
8993 self.Object_Reference or
8994 self.Object
8995 ):
8996 return True
8997 else:
8998 return False
9007 showIndent(outfile, level)
9008 outfile.write('Object_Reference=[\n')
9009 level += 1
9010 for Object_Reference_ in self.Object_Reference:
9011 showIndent(outfile, level)
9012 outfile.write('model_.ObjectReferenceType(\n')
9013 Object_Reference_.exportLiteral(outfile, level, name_='ObjectReferenceType')
9014 showIndent(outfile, level)
9015 outfile.write('),\n')
9016 level -= 1
9017 showIndent(outfile, level)
9018 outfile.write('],\n')
9019 showIndent(outfile, level)
9020 outfile.write('Object=[\n')
9021 level += 1
9022 for Object_ in self.Object:
9023 showIndent(outfile, level)
9024 outfile.write('model_.ObjectType(\n')
9025 Object_.exportLiteral(outfile, level, name_='ObjectType')
9026 showIndent(outfile, level)
9027 outfile.write('),\n')
9028 level -= 1
9029 showIndent(outfile, level)
9030 outfile.write('],\n')
9038 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
9039 if nodeName_ == 'Object_Reference':
9040 obj_ = ObjectReferenceType.factory()
9041 obj_.build(child_)
9042 self.Object_Reference.append(obj_)
9043 elif nodeName_ == 'Object':
9044 obj_ = ObjectType.factory()
9045 obj_.build(child_)
9046 self.Object.append(obj_)
9047
9048
9049
9051 subclass = None
9052 superclass = None
9053 - def __init__(self, Effect=None, Effect_Reference=None):
9054 if Effect is None:
9055 self.Effect = []
9056 else:
9057 self.Effect = Effect
9058 if Effect_Reference is None:
9059 self.Effect_Reference = []
9060 else:
9061 self.Effect_Reference = Effect_Reference
9067 factory = staticmethod(factory)
9069 - def set_Effect(self, Effect): self.Effect = Effect
9070 - def add_Effect(self, value): self.Effect.append(value)
9071 - def insert_Effect(self, index, value): self.Effect[index] = value
9076 - def export(self, outfile, level, namespace_='maec:', name_='EffectsType1', namespacedef_=''):
9077 showIndent(outfile, level)
9078 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
9079 already_processed = []
9080 self.exportAttributes(outfile, level, already_processed, namespace_, name_='EffectsType1')
9081 if self.hasContent_():
9082 outfile.write('>\n')
9083 self.exportChildren(outfile, level + 1, namespace_, name_)
9084 showIndent(outfile, level)
9085 outfile.write('</%s%s>\n' % (namespace_, name_))
9086 else:
9087 outfile.write('/>\n')
9088 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='EffectsType1'):
9090 - def exportChildren(self, outfile, level, namespace_='maec:', name_='EffectsType1', fromsubclass_=False):
9091 for Effect_ in self.Effect:
9092 Effect_.export(outfile, level, namespace_, name_='Effect')
9093 for Effect_Reference_ in self.Effect_Reference:
9094 Effect_Reference_.export(outfile, level, namespace_, name_='Effect_Reference')
9095 - def hasContent_(self):
9096 if (
9097 self.Effect or
9098 self.Effect_Reference
9099 ):
9100 return True
9101 else:
9102 return False
9111 showIndent(outfile, level)
9112 outfile.write('Effect=[\n')
9113 level += 1
9114 for Effect_ in self.Effect:
9115 showIndent(outfile, level)
9116 outfile.write('model_.EffectType(\n')
9117 Effect_.exportLiteral(outfile, level, name_='EffectType')
9118 showIndent(outfile, level)
9119 outfile.write('),\n')
9120 level -= 1
9121 showIndent(outfile, level)
9122 outfile.write('],\n')
9123 showIndent(outfile, level)
9124 outfile.write('Effect_Reference=[\n')
9125 level += 1
9126 for Effect_Reference_ in self.Effect_Reference:
9127 showIndent(outfile, level)
9128 outfile.write('model_.EffectReferenceType(\n')
9129 Effect_Reference_.exportLiteral(outfile, level, name_='EffectReferenceType')
9130 showIndent(outfile, level)
9131 outfile.write('),\n')
9132 level -= 1
9133 showIndent(outfile, level)
9134 outfile.write('],\n')
9142 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
9143 if nodeName_ == 'Effect':
9144 obj_ = EffectType.factory()
9145 obj_.build(child_)
9146 self.Effect.append(obj_)
9147 elif nodeName_ == 'Effect_Reference':
9148 obj_ = EffectReferenceType.factory()
9149 obj_.build(child_)
9150 self.Effect_Reference.append(obj_)
9151
9152
9153
9228
9229
9230
9308
9309
9310
9312 """This field defines the relationship between the characterized
9313 behavior and the one being referenced. Possible values:
9314 Following_Dependency, Preceding_Dependency, Other."""
9315 subclass = None
9316 superclass = None
9324 factory = staticmethod(factory)
9325 - def export(self, outfile, level, namespace_='maec:', name_='Nature_of_Relationship', namespacedef_=''):
9326 showIndent(outfile, level)
9327 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
9328 already_processed = []
9329 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Nature_of_Relationship')
9330 if self.hasContent_():
9331 outfile.write('>\n')
9332 self.exportChildren(outfile, level + 1, namespace_, name_)
9333 outfile.write('</%s%s>\n' % (namespace_, name_))
9334 else:
9335 outfile.write('/>\n')
9336 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Nature_of_Relationship'):
9338 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Nature_of_Relationship', fromsubclass_=False):
9340 - def hasContent_(self):
9341 if (
9342
9343 ):
9344 return True
9345 else:
9346 return False
9347 - def exportLiteral(self, outfile, level, name_='Nature_of_Relationship'):
9363 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
9365
9366
9367
9369 subclass = None
9370 superclass = None
9371 - def __init__(self, Effect=None, Effect_Reference=None):
9372 if Effect is None:
9373 self.Effect = []
9374 else:
9375 self.Effect = Effect
9376 if Effect_Reference is None:
9377 self.Effect_Reference = []
9378 else:
9379 self.Effect_Reference = Effect_Reference
9385 factory = staticmethod(factory)
9387 - def set_Effect(self, Effect): self.Effect = Effect
9388 - def add_Effect(self, value): self.Effect.append(value)
9389 - def insert_Effect(self, index, value): self.Effect[index] = value
9394 - def export(self, outfile, level, namespace_='maec:', name_='EffectsType2', namespacedef_=''):
9395 showIndent(outfile, level)
9396 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
9397 already_processed = []
9398 self.exportAttributes(outfile, level, already_processed, namespace_, name_='EffectsType2')
9399 if self.hasContent_():
9400 outfile.write('>\n')
9401 self.exportChildren(outfile, level + 1, namespace_, name_)
9402 showIndent(outfile, level)
9403 outfile.write('</%s%s>\n' % (namespace_, name_))
9404 else:
9405 outfile.write('/>\n')
9406 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='EffectsType2'):
9408 - def exportChildren(self, outfile, level, namespace_='maec:', name_='EffectsType2', fromsubclass_=False):
9409 for Effect_ in self.Effect:
9410 Effect_.export(outfile, level, namespace_, name_='Effect')
9411 for Effect_Reference_ in self.Effect_Reference:
9412 Effect_Reference_.export(outfile, level, namespace_, name_='Effect_Reference')
9413 - def hasContent_(self):
9414 if (
9415 self.Effect or
9416 self.Effect_Reference
9417 ):
9418 return True
9419 else:
9420 return False
9429 showIndent(outfile, level)
9430 outfile.write('Effect=[\n')
9431 level += 1
9432 for Effect_ in self.Effect:
9433 showIndent(outfile, level)
9434 outfile.write('model_.EffectType(\n')
9435 Effect_.exportLiteral(outfile, level, name_='EffectType')
9436 showIndent(outfile, level)
9437 outfile.write('),\n')
9438 level -= 1
9439 showIndent(outfile, level)
9440 outfile.write('],\n')
9441 showIndent(outfile, level)
9442 outfile.write('Effect_Reference=[\n')
9443 level += 1
9444 for Effect_Reference_ in self.Effect_Reference:
9445 showIndent(outfile, level)
9446 outfile.write('model_.EffectReferenceType(\n')
9447 Effect_Reference_.exportLiteral(outfile, level, name_='EffectReferenceType')
9448 showIndent(outfile, level)
9449 outfile.write('),\n')
9450 level -= 1
9451 showIndent(outfile, level)
9452 outfile.write('],\n')
9460 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
9461 if nodeName_ == 'Effect':
9462 obj_ = EffectType.factory()
9463 obj_.build(child_)
9464 self.Effect.append(obj_)
9465 elif nodeName_ == 'Effect_Reference':
9466 obj_ = EffectReferenceType.factory()
9467 obj_.build(child_)
9468 self.Effect_Reference.append(obj_)
9469
9470
9471
9473 """This attribute is used to state the type of object which initiated
9474 the action. Possible values: Process, Other."""
9475 subclass = None
9476 superclass = None
9477 - def __init__(self, type_=None, Initiator_Object=None):
9478 self.type_ = _cast(None, type_)
9479 self.Initiator_Object = Initiator_Object
9485 factory = staticmethod(factory)
9489 - def set_type(self, type_): self.type_ = type_
9490 - def export(self, outfile, level, namespace_='maec:', name_='Action_InitiatorType', namespacedef_=''):
9491 showIndent(outfile, level)
9492 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
9493 already_processed = []
9494 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Action_InitiatorType')
9495 if self.hasContent_():
9496 outfile.write('>\n')
9497 self.exportChildren(outfile, level + 1, namespace_, name_)
9498 showIndent(outfile, level)
9499 outfile.write('</%s%s>\n' % (namespace_, name_))
9500 else:
9501 outfile.write('/>\n')
9502 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Action_InitiatorType'):
9503 if self.type_ is not None and 'type_' not in already_processed:
9504 already_processed.append('type_')
9505 outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))
9506 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Action_InitiatorType', fromsubclass_=False):
9507 if self.Initiator_Object is not None:
9508 self.Initiator_Object.export(outfile, level, namespace_, name_='Initiator_Object')
9509 - def hasContent_(self):
9510 if (
9511 self.Initiator_Object is not None
9512 ):
9513 return True
9514 else:
9515 return False
9516 - def exportLiteral(self, outfile, level, name_='Action_InitiatorType'):
9522 if self.type_ is not None and 'type_' not in already_processed:
9523 already_processed.append('type_')
9524 showIndent(outfile, level)
9525 outfile.write('type_ = "%s",\n' % (self.type_,))
9527 if self.Initiator_Object is not None:
9528 showIndent(outfile, level)
9529 outfile.write('Initiator_Object=model_.ObjectReferenceType(\n')
9530 self.Initiator_Object.exportLiteral(outfile, level, name_='Initiator_Object')
9531 showIndent(outfile, level)
9532 outfile.write('),\n')
9539 value = find_attr_value_('type', node)
9540 if value is not None and 'type' not in already_processed:
9541 already_processed.append('type')
9542 self.type_ = value
9543 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
9548
9549
9550
9552 subclass = None
9553 superclass = None
9554 - def __init__(self, Object_Reference=None, Object=None):
9555 if Object_Reference is None:
9556 self.Object_Reference = []
9557 else:
9558 self.Object_Reference = Object_Reference
9559 if Object is None:
9560 self.Object = []
9561 else:
9562 self.Object = Object
9568 factory = staticmethod(factory)
9574 - def set_Object(self, Object): self.Object = Object
9575 - def add_Object(self, value): self.Object.append(value)
9576 - def insert_Object(self, index, value): self.Object[index] = value
9577 - def export(self, outfile, level, namespace_='maec:', name_='ObjectsType1', namespacedef_=''):
9578 showIndent(outfile, level)
9579 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
9580 already_processed = []
9581 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ObjectsType1')
9582 if self.hasContent_():
9583 outfile.write('>\n')
9584 self.exportChildren(outfile, level + 1, namespace_, name_)
9585 showIndent(outfile, level)
9586 outfile.write('</%s%s>\n' % (namespace_, name_))
9587 else:
9588 outfile.write('/>\n')
9589 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ObjectsType1'):
9591 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ObjectsType1', fromsubclass_=False):
9592 for Object_Reference_ in self.Object_Reference:
9593 Object_Reference_.export(outfile, level, namespace_, name_='Object_Reference')
9594 for Object_ in self.Object:
9595 Object_.export(outfile, level, namespace_, name_='Object')
9596 - def hasContent_(self):
9597 if (
9598 self.Object_Reference or
9599 self.Object
9600 ):
9601 return True
9602 else:
9603 return False
9612 showIndent(outfile, level)
9613 outfile.write('Object_Reference=[\n')
9614 level += 1
9615 for Object_Reference_ in self.Object_Reference:
9616 showIndent(outfile, level)
9617 outfile.write('model_.ObjectReferenceType(\n')
9618 Object_Reference_.exportLiteral(outfile, level, name_='ObjectReferenceType')
9619 showIndent(outfile, level)
9620 outfile.write('),\n')
9621 level -= 1
9622 showIndent(outfile, level)
9623 outfile.write('],\n')
9624 showIndent(outfile, level)
9625 outfile.write('Object=[\n')
9626 level += 1
9627 for Object_ in self.Object:
9628 showIndent(outfile, level)
9629 outfile.write('model_.ObjectType(\n')
9630 Object_.exportLiteral(outfile, level, name_='ObjectType')
9631 showIndent(outfile, level)
9632 outfile.write('),\n')
9633 level -= 1
9634 showIndent(outfile, level)
9635 outfile.write('],\n')
9643 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
9644 if nodeName_ == 'Object_Reference':
9645 obj_ = ObjectReferenceType.factory()
9646 obj_.build(child_)
9647 self.Object_Reference.append(obj_)
9648 elif nodeName_ == 'Object':
9649 obj_ = ObjectType.factory()
9650 obj_.build(child_)
9651 self.Object.append(obj_)
9652
9653
9654
9656 subclass = None
9657 superclass = None
9658 - def __init__(self, Effect=None, Effect_Reference=None):
9659 if Effect is None:
9660 self.Effect = []
9661 else:
9662 self.Effect = Effect
9663 if Effect_Reference is None:
9664 self.Effect_Reference = []
9665 else:
9666 self.Effect_Reference = Effect_Reference
9672 factory = staticmethod(factory)
9674 - def set_Effect(self, Effect): self.Effect = Effect
9675 - def add_Effect(self, value): self.Effect.append(value)
9676 - def insert_Effect(self, index, value): self.Effect[index] = value
9681 - def export(self, outfile, level, namespace_='maec:', name_='EffectsType3', namespacedef_=''):
9682 showIndent(outfile, level)
9683 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
9684 already_processed = []
9685 self.exportAttributes(outfile, level, already_processed, namespace_, name_='EffectsType3')
9686 if self.hasContent_():
9687 outfile.write('>\n')
9688 self.exportChildren(outfile, level + 1, namespace_, name_)
9689 showIndent(outfile, level)
9690 outfile.write('</%s%s>\n' % (namespace_, name_))
9691 else:
9692 outfile.write('/>\n')
9693 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='EffectsType3'):
9695 - def exportChildren(self, outfile, level, namespace_='maec:', name_='EffectsType3', fromsubclass_=False):
9696 for Effect_ in self.Effect:
9697 Effect_.export(outfile, level, namespace_, name_='Effect')
9698 for Effect_Reference_ in self.Effect_Reference:
9699 Effect_Reference_.export(outfile, level, namespace_, name_='Effect_Reference')
9700 - def hasContent_(self):
9701 if (
9702 self.Effect or
9703 self.Effect_Reference
9704 ):
9705 return True
9706 else:
9707 return False
9716 showIndent(outfile, level)
9717 outfile.write('Effect=[\n')
9718 level += 1
9719 for Effect_ in self.Effect:
9720 showIndent(outfile, level)
9721 outfile.write('model_.EffectType(\n')
9722 Effect_.exportLiteral(outfile, level, name_='EffectType')
9723 showIndent(outfile, level)
9724 outfile.write('),\n')
9725 level -= 1
9726 showIndent(outfile, level)
9727 outfile.write('],\n')
9728 showIndent(outfile, level)
9729 outfile.write('Effect_Reference=[\n')
9730 level += 1
9731 for Effect_Reference_ in self.Effect_Reference:
9732 showIndent(outfile, level)
9733 outfile.write('model_.EffectReferenceType(\n')
9734 Effect_Reference_.exportLiteral(outfile, level, name_='EffectReferenceType')
9735 showIndent(outfile, level)
9736 outfile.write('),\n')
9737 level -= 1
9738 showIndent(outfile, level)
9739 outfile.write('],\n')
9747 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
9748 if nodeName_ == 'Effect':
9749 obj_ = EffectType.factory()
9750 obj_.build(child_)
9751 self.Effect.append(obj_)
9752 elif nodeName_ == 'Effect_Reference':
9753 obj_ = EffectReferenceType.factory()
9754 obj_.build(child_)
9755 self.Effect_Reference.append(obj_)
9756
9757
9758
9833
9834
9835
9913
9914
9915
9917 """This attribute represents the Units used in the object size field.
9918 Possible values are: Bytes, Kilobytes, Megabytes."""
9919 subclass = None
9920 superclass = None
9921 - def __init__(self, units=None, valueOf_=None):
9922 self.units = _cast(None, units)
9923 self.valueOf_ = valueOf_
9929 factory = staticmethod(factory)
9931 - def set_units(self, units): self.units = units
9933 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
9934 - def export(self, outfile, level, namespace_='maec:', name_='Object_SizeType', namespacedef_=''):
9935 showIndent(outfile, level)
9936 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
9937 already_processed = []
9938 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Object_SizeType')
9939 if self.hasContent_():
9940 outfile.write('>')
9941 outfile.write(str(self.valueOf_).encode(ExternalEncoding))
9942 self.exportChildren(outfile, level + 1, namespace_, name_)
9943 outfile.write('</%s%s>\n' % (namespace_, name_))
9944 else:
9945 outfile.write('/>\n')
9946 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Object_SizeType'):
9947 if self.units is not None and 'units' not in already_processed:
9948 already_processed.append('units')
9949 outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
9950 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Object_SizeType', fromsubclass_=False):
9952 - def hasContent_(self):
9953 if (
9954 self.valueOf_
9955 ):
9956 return True
9957 else:
9958 return False
9959 - def exportLiteral(self, outfile, level, name_='Object_SizeType'):
9967 if self.units is not None and 'units' not in already_processed:
9968 already_processed.append('units')
9969 showIndent(outfile, level)
9970 outfile.write('units = "%s",\n' % (self.units,))
9980 value = find_attr_value_('units', node)
9981 if value is not None and 'units' not in already_processed:
9982 already_processed.append('units')
9983 self.units = value
9984 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
9986
9987
9988
9990 subclass = None
9991 superclass = None
9992 - def __init__(self, Classification=None):
9993 if Classification is None:
9994 self.Classification = []
9995 else:
9996 self.Classification = Classification
10002 factory = staticmethod(factory)
10007 - def export(self, outfile, level, namespace_='maec:', name_='ClassificationsType', namespacedef_=''):
10008 showIndent(outfile, level)
10009 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
10010 already_processed = []
10011 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ClassificationsType')
10012 if self.hasContent_():
10013 outfile.write('>\n')
10014 self.exportChildren(outfile, level + 1, namespace_, name_)
10015 showIndent(outfile, level)
10016 outfile.write('</%s%s>\n' % (namespace_, name_))
10017 else:
10018 outfile.write('/>\n')
10019 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ClassificationsType'):
10021 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ClassificationsType', fromsubclass_=False):
10022 for Classification_ in self.Classification:
10023 Classification_.export(outfile, level, namespace_, name_='Classification')
10024 - def hasContent_(self):
10025 if (
10026 self.Classification
10027 ):
10028 return True
10029 else:
10030 return False
10031 - def exportLiteral(self, outfile, level, name_='ClassificationsType'):
10039 showIndent(outfile, level)
10040 outfile.write('Classification=[\n')
10041 level += 1
10042 for Classification_ in self.Classification:
10043 showIndent(outfile, level)
10044 outfile.write('model_.classificationObject(\n')
10045 Classification_.exportLiteral(outfile, level, name_='classificationObject')
10046 showIndent(outfile, level)
10047 outfile.write('),\n')
10048 level -= 1
10049 showIndent(outfile, level)
10050 outfile.write('],\n')
10051 - def build(self, node):
10058 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
10063
10064
10065
10067 subclass = None
10068 superclass = None
10069 - def __init__(self, Associated_Code_Snippet=None):
10070 if Associated_Code_Snippet is None:
10071 self.Associated_Code_Snippet = []
10072 else:
10073 self.Associated_Code_Snippet = Associated_Code_Snippet
10079 factory = staticmethod(factory)
10084 - def export(self, outfile, level, namespace_='maec:', name_='Associated_CodeType', namespacedef_=''):
10085 showIndent(outfile, level)
10086 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
10087 already_processed = []
10088 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Associated_CodeType')
10089 if self.hasContent_():
10090 outfile.write('>\n')
10091 self.exportChildren(outfile, level + 1, namespace_, name_)
10092 showIndent(outfile, level)
10093 outfile.write('</%s%s>\n' % (namespace_, name_))
10094 else:
10095 outfile.write('/>\n')
10096 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Associated_CodeType'):
10098 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Associated_CodeType', fromsubclass_=False):
10099 for Associated_Code_Snippet_ in self.Associated_Code_Snippet:
10100 Associated_Code_Snippet_.export(outfile, level, namespace_, name_='Associated_Code_Snippet')
10101 - def hasContent_(self):
10102 if (
10103 self.Associated_Code_Snippet
10104 ):
10105 return True
10106 else:
10107 return False
10108 - def exportLiteral(self, outfile, level, name_='Associated_CodeType'):
10116 showIndent(outfile, level)
10117 outfile.write('Associated_Code_Snippet=[\n')
10118 level += 1
10119 for Associated_Code_Snippet_ in self.Associated_Code_Snippet:
10120 showIndent(outfile, level)
10121 outfile.write('model_.Associated_Code_SnippetType(\n')
10122 Associated_Code_Snippet_.exportLiteral(outfile, level, name_='Associated_Code_SnippetType')
10123 showIndent(outfile, level)
10124 outfile.write('),\n')
10125 level -= 1
10126 showIndent(outfile, level)
10127 outfile.write('],\n')
10128 - def build(self, node):
10135 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
10140
10141
10142
10144 subclass = None
10145 superclass = None
10146 - def __init__(self, Code_Snippet=None, Nature_Of_Relationship=None):
10154 factory = staticmethod(factory)
10159 - def export(self, outfile, level, namespace_='maec:', name_='Associated_Code_SnippetType', namespacedef_=''):
10160 showIndent(outfile, level)
10161 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
10162 already_processed = []
10163 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Associated_Code_SnippetType')
10164 if self.hasContent_():
10165 outfile.write('>\n')
10166 self.exportChildren(outfile, level + 1, namespace_, name_)
10167 showIndent(outfile, level)
10168 outfile.write('</%s%s>\n' % (namespace_, name_))
10169 else:
10170 outfile.write('/>\n')
10171 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Associated_Code_SnippetType'):
10173 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Associated_Code_SnippetType', fromsubclass_=False):
10179 - def hasContent_(self):
10180 if (
10181 self.Code_Snippet is not None or
10182 self.Nature_Of_Relationship is not None
10183 ):
10184 return True
10185 else:
10186 return False
10187 - def exportLiteral(self, outfile, level, name_='Associated_Code_SnippetType'):
10204 - def build(self, node):
10211 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
10212 if nodeName_ == 'Code_Snippet':
10213 obj_ = CodeType.factory()
10214 obj_.build(child_)
10215 self.set_Code_Snippet(obj_)
10216 elif nodeName_ == 'Nature_Of_Relationship':
10217 Nature_Of_Relationship_ = child_.text
10218 Nature_Of_Relationship_ = self.gds_validate_string(Nature_Of_Relationship_, node, 'Nature_Of_Relationship')
10219 self.Nature_Of_Relationship = Nature_Of_Relationship_
10220
10221
10222
10224 """This field defines the relationship between the object and code
10225 segment referenced in this element. Possible values:
10226 Contained_Inside, Created_By, Other."""
10227 subclass = None
10228 superclass = None
10236 factory = staticmethod(factory)
10237 - def export(self, outfile, level, namespace_='maec:', name_='Nature_Of_Relationship', namespacedef_=''):
10238 showIndent(outfile, level)
10239 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
10240 already_processed = []
10241 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Nature_Of_Relationship')
10242 if self.hasContent_():
10243 outfile.write('>\n')
10244 self.exportChildren(outfile, level + 1, namespace_, name_)
10245 outfile.write('</%s%s>\n' % (namespace_, name_))
10246 else:
10247 outfile.write('/>\n')
10248 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Nature_Of_Relationship'):
10250 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Nature_Of_Relationship', fromsubclass_=False):
10252 - def hasContent_(self):
10253 if (
10254
10255 ):
10256 return True
10257 else:
10258 return False
10259 - def exportLiteral(self, outfile, level, name_='Nature_Of_Relationship'):
10268 - def build(self, node):
10275 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
10277
10278
10279
10354
10355
10356
10434
10435
10436
10438 subclass = None
10439 superclass = None
10440 - def __init__(self, DateTime_Created=None, DateTime_Modified=None, Path=None, Hashes=None, Permissions=None, File_Type=None, Packing=None, Pipe_Mode=None, Maximum_Instances=None, Security_Attributes=None, Origin=None, File_Type_Attributes=None):
10441 self.DateTime_Created = DateTime_Created
10442 self.DateTime_Modified = DateTime_Modified
10443 self.Path = Path
10444 self.Hashes = Hashes
10445 self.Permissions = Permissions
10446 self.File_Type = File_Type
10447 self.Packing = Packing
10448 self.Pipe_Mode = Pipe_Mode
10449 self.Maximum_Instances = Maximum_Instances
10450 self.Security_Attributes = Security_Attributes
10451 self.Origin = Origin
10452 self.File_Type_Attributes = File_Type_Attributes
10458 factory = staticmethod(factory)
10464 - def set_Path(self, Path): self.Path = Path
10466 - def set_Hashes(self, Hashes): self.Hashes = Hashes
10470 - def set_File_Type(self, File_Type): self.File_Type = File_Type
10472 - def set_Packing(self, Packing): self.Packing = Packing
10474 - def set_Pipe_Mode(self, Pipe_Mode): self.Pipe_Mode = Pipe_Mode
10480 - def set_Origin(self, Origin): self.Origin = Origin
10483 - def export(self, outfile, level, namespace_='maec:', name_='File_System_Object_AttributesType', namespacedef_=''):
10484 showIndent(outfile, level)
10485 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
10486 already_processed = []
10487 self.exportAttributes(outfile, level, already_processed, namespace_, name_='File_System_Object_AttributesType')
10488 if self.hasContent_():
10489 outfile.write('>\n')
10490 self.exportChildren(outfile, level + 1, namespace_, name_)
10491 showIndent(outfile, level)
10492 outfile.write('</%s%s>\n' % (namespace_, name_))
10493 else:
10494 outfile.write('/>\n')
10495 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='File_System_Object_AttributesType'):
10497 - def exportChildren(self, outfile, level, namespace_='maec:', name_='File_System_Object_AttributesType', fromsubclass_=False):
10498 if self.DateTime_Created is not None:
10499 showIndent(outfile, level)
10500 outfile.write('<%sDateTime_Created>%s</%sDateTime_Created>\n' % (namespace_, self.gds_format_string(quote_xml(self.DateTime_Created).encode(ExternalEncoding), input_name='DateTime_Created'), namespace_))
10501 if self.DateTime_Modified is not None:
10502 showIndent(outfile, level)
10503 outfile.write('<%sDateTime_Modified>%s</%sDateTime_Modified>\n' % (namespace_, self.gds_format_string(quote_xml(self.DateTime_Modified).encode(ExternalEncoding), input_name='DateTime_Modified'), namespace_))
10504 if self.Path is not None:
10505 self.Path.export(outfile, level, namespace_, name_='Path')
10506 if self.Hashes is not None:
10507 self.Hashes.export(outfile, level, namespace_, name_='Hashes')
10508 if self.Permissions is not None:
10509 showIndent(outfile, level)
10510 outfile.write('<%sPermissions>%s</%sPermissions>\n' % (namespace_, self.gds_format_string(quote_xml(self.Permissions).encode(ExternalEncoding), input_name='Permissions'), namespace_))
10511 if self.File_Type is not None:
10512 self.File_Type.export(outfile, level, namespace_, name_='File_Type')
10513 if self.Packing is not None:
10514 self.Packing.export(outfile, level, namespace_, name_='Packing')
10515 if self.Pipe_Mode is not None:
10516 showIndent(outfile, level)
10517 outfile.write('<%sPipe_Mode>%s</%sPipe_Mode>\n' % (namespace_, self.gds_format_string(quote_xml(self.Pipe_Mode).encode(ExternalEncoding), input_name='Pipe_Mode'), namespace_))
10518 if self.Maximum_Instances is not None:
10519 showIndent(outfile, level)
10520 outfile.write('<%sMaximum_Instances>%s</%sMaximum_Instances>\n' % (namespace_, self.gds_format_integer(self.Maximum_Instances, input_name='Maximum_Instances'), namespace_))
10521 if self.Security_Attributes is not None:
10522 showIndent(outfile, level)
10523 outfile.write('<%sSecurity_Attributes>%s</%sSecurity_Attributes>\n' % (namespace_, self.gds_format_string(quote_xml(self.Security_Attributes).encode(ExternalEncoding), input_name='Security_Attributes'), namespace_))
10524 if self.Origin is not None:
10525 self.Origin.export(outfile, level, namespace_, name_='Origin')
10526 if self.File_Type_Attributes is not None:
10527 self.File_Type_Attributes.export(outfile, level, namespace_, name_='File_Type_Attributes')
10528 - def hasContent_(self):
10529 if (
10530 self.DateTime_Created is not None or
10531 self.DateTime_Modified is not None or
10532 self.Path is not None or
10533 self.Hashes is not None or
10534 self.Permissions is not None or
10535 self.File_Type is not None or
10536 self.Packing is not None or
10537 self.Pipe_Mode is not None or
10538 self.Maximum_Instances is not None or
10539 self.Security_Attributes is not None or
10540 self.Origin is not None or
10541 self.File_Type_Attributes is not None
10542 ):
10543 return True
10544 else:
10545 return False
10546 - def exportLiteral(self, outfile, level, name_='File_System_Object_AttributesType'):
10554 if self.DateTime_Created is not None:
10555 showIndent(outfile, level)
10556 outfile.write('DateTime_Created=%s,\n' % quote_python(self.DateTime_Created).encode(ExternalEncoding))
10557 if self.DateTime_Modified is not None:
10558 showIndent(outfile, level)
10559 outfile.write('DateTime_Modified=%s,\n' % quote_python(self.DateTime_Modified).encode(ExternalEncoding))
10560 if self.Path is not None:
10561 showIndent(outfile, level)
10562 outfile.write('Path=model_.PathType(\n')
10563 self.Path.exportLiteral(outfile, level, name_='Path')
10564 showIndent(outfile, level)
10565 outfile.write('),\n')
10566 if self.Hashes is not None:
10567 showIndent(outfile, level)
10568 outfile.write('Hashes=model_.HashesType(\n')
10569 self.Hashes.exportLiteral(outfile, level, name_='Hashes')
10570 showIndent(outfile, level)
10571 outfile.write('),\n')
10572 if self.Permissions is not None:
10573 showIndent(outfile, level)
10574 outfile.write('Permissions=%s,\n' % quote_python(self.Permissions).encode(ExternalEncoding))
10575 if self.File_Type is not None:
10576 showIndent(outfile, level)
10577 outfile.write('File_Type=model_.File_TypeType(\n')
10578 self.File_Type.exportLiteral(outfile, level, name_='File_Type')
10579 showIndent(outfile, level)
10580 outfile.write('),\n')
10581 if self.Packing is not None:
10582 showIndent(outfile, level)
10583 outfile.write('Packing=model_.PackingType(\n')
10584 self.Packing.exportLiteral(outfile, level, name_='Packing')
10585 showIndent(outfile, level)
10586 outfile.write('),\n')
10587 if self.Pipe_Mode is not None:
10588 showIndent(outfile, level)
10589 outfile.write('Pipe_Mode=%s,\n' % quote_python(self.Pipe_Mode).encode(ExternalEncoding))
10590 if self.Maximum_Instances is not None:
10591 showIndent(outfile, level)
10592 outfile.write('Maximum_Instances=%d,\n' % self.Maximum_Instances)
10593 if self.Security_Attributes is not None:
10594 showIndent(outfile, level)
10595 outfile.write('Security_Attributes=%s,\n' % quote_python(self.Security_Attributes).encode(ExternalEncoding))
10596 if self.Origin is not None:
10597 showIndent(outfile, level)
10598 outfile.write('Origin=model_.uriObject(\n')
10599 self.Origin.exportLiteral(outfile, level, name_='Origin')
10600 showIndent(outfile, level)
10601 outfile.write('),\n')
10602 if self.File_Type_Attributes is not None:
10603 showIndent(outfile, level)
10604 outfile.write('File_Type_Attributes=model_.File_Type_AttributesType(\n')
10605 self.File_Type_Attributes.exportLiteral(outfile, level, name_='File_Type_Attributes')
10606 showIndent(outfile, level)
10607 outfile.write('),\n')
10608 - def build(self, node):
10615 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
10616 if nodeName_ == 'DateTime_Created':
10617 DateTime_Created_ = child_.text
10618 DateTime_Created_ = self.gds_validate_string(DateTime_Created_, node, 'DateTime_Created')
10619 self.DateTime_Created = DateTime_Created_
10620 elif nodeName_ == 'DateTime_Modified':
10621 DateTime_Modified_ = child_.text
10622 DateTime_Modified_ = self.gds_validate_string(DateTime_Modified_, node, 'DateTime_Modified')
10623 self.DateTime_Modified = DateTime_Modified_
10624 elif nodeName_ == 'Path':
10625 obj_ = PathType.factory()
10626 obj_.build(child_)
10627 self.set_Path(obj_)
10628 elif nodeName_ == 'Hashes':
10629 obj_ = HashesType.factory()
10630 obj_.build(child_)
10631 self.set_Hashes(obj_)
10632 elif nodeName_ == 'Permissions':
10633 Permissions_ = child_.text
10634 Permissions_ = self.gds_validate_string(Permissions_, node, 'Permissions')
10635 self.Permissions = Permissions_
10636 elif nodeName_ == 'File_Type':
10637 obj_ = File_TypeType.factory()
10638 obj_.build(child_)
10639 self.set_File_Type(obj_)
10640 elif nodeName_ == 'Packing':
10641 obj_ = PackingType.factory()
10642 obj_.build(child_)
10643 self.set_Packing(obj_)
10644 elif nodeName_ == 'Pipe_Mode':
10645 Pipe_Mode_ = child_.text
10646 Pipe_Mode_ = self.gds_validate_string(Pipe_Mode_, node, 'Pipe_Mode')
10647 self.Pipe_Mode = Pipe_Mode_
10648 elif nodeName_ == 'Maximum_Instances':
10649 sval_ = child_.text
10650 try:
10651 ival_ = int(sval_)
10652 except (TypeError, ValueError) as e:
10653 raise_parse_error(child_, 'requires integer: %s' % e)
10654 ival_ = self.gds_validate_integer(ival_, node, 'Maximum_Instances')
10655 self.Maximum_Instances = ival_
10656 elif nodeName_ == 'Security_Attributes':
10657 Security_Attributes_ = child_.text
10658 Security_Attributes_ = self.gds_validate_string(Security_Attributes_, node, 'Security_Attributes')
10659 self.Security_Attributes = Security_Attributes_
10660 elif nodeName_ == 'Origin':
10661 obj_ = uriObject.factory()
10662 obj_.build(child_)
10663 self.set_Origin(obj_)
10664 elif nodeName_ == 'File_Type_Attributes':
10665 obj_ = File_Type_AttributesType.factory()
10666 obj_.build(child_)
10667 self.set_File_Type_Attributes(obj_)
10668
10669
10670
10672 """This attribute refers to the type of path that this element refers
10673 to. Possible values: Fully_Qualified, Relative."""
10674 subclass = None
10675 superclass = None
10676 - def __init__(self, type_=None, valueOf_=None):
10677 self.type_ = _cast(None, type_)
10678 self.valueOf_ = valueOf_
10684 factory = staticmethod(factory)
10685 - def get_type(self): return self.type_
10686 - def set_type(self, type_): self.type_ = type_
10688 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
10689 - def export(self, outfile, level, namespace_='maec:', name_='PathType', namespacedef_=''):
10690 showIndent(outfile, level)
10691 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
10692 already_processed = []
10693 self.exportAttributes(outfile, level, already_processed, namespace_, name_='PathType')
10694 if self.hasContent_():
10695 outfile.write('>')
10696 outfile.write(str(self.valueOf_).encode(ExternalEncoding))
10697 self.exportChildren(outfile, level + 1, namespace_, name_)
10698 outfile.write('</%s%s>\n' % (namespace_, name_))
10699 else:
10700 outfile.write('/>\n')
10701 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='PathType'):
10702 if self.type_ is not None and 'type_' not in already_processed:
10703 already_processed.append('type_')
10704 outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))
10705 - def exportChildren(self, outfile, level, namespace_='maec:', name_='PathType', fromsubclass_=False):
10707 - def hasContent_(self):
10708 if (
10709 self.valueOf_
10710 ):
10711 return True
10712 else:
10713 return False
10722 if self.type_ is not None and 'type_' not in already_processed:
10723 already_processed.append('type_')
10724 showIndent(outfile, level)
10725 outfile.write('type_ = "%s",\n' % (self.type_,))
10728 - def build(self, node):
10735 value = find_attr_value_('type', node)
10736 if value is not None and 'type' not in already_processed:
10737 already_processed.append('type')
10738 self.type_ = value
10739 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
10741
10742
10743
10745 subclass = None
10746 superclass = None
10748 if Hash is None:
10749 self.Hash = []
10750 else:
10751 self.Hash = Hash
10757 factory = staticmethod(factory)
10759 - def set_Hash(self, Hash): self.Hash = Hash
10760 - def add_Hash(self, value): self.Hash.append(value)
10761 - def insert_Hash(self, index, value): self.Hash[index] = value
10762 - def export(self, outfile, level, namespace_='maec:', name_='HashesType', namespacedef_=''):
10763 showIndent(outfile, level)
10764 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
10765 already_processed = []
10766 self.exportAttributes(outfile, level, already_processed, namespace_, name_='HashesType')
10767 if self.hasContent_():
10768 outfile.write('>\n')
10769 self.exportChildren(outfile, level + 1, namespace_, name_)
10770 showIndent(outfile, level)
10771 outfile.write('</%s%s>\n' % (namespace_, name_))
10772 else:
10773 outfile.write('/>\n')
10774 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='HashesType'):
10776 - def exportChildren(self, outfile, level, namespace_='maec:', name_='HashesType', fromsubclass_=False):
10777 for Hash_ in self.Hash:
10778 Hash_.export(outfile, level, namespace_, name_='Hash')
10779 - def hasContent_(self):
10780 if (
10781 self.Hash
10782 ):
10783 return True
10784 else:
10785 return False
10794 showIndent(outfile, level)
10795 outfile.write('Hash=[\n')
10796 level += 1
10797 for Hash_ in self.Hash:
10798 showIndent(outfile, level)
10799 outfile.write('model_.HashType(\n')
10800 Hash_.exportLiteral(outfile, level, name_='HashType')
10801 showIndent(outfile, level)
10802 outfile.write('),\n')
10803 level -= 1
10804 showIndent(outfile, level)
10805 outfile.write('],\n')
10806 - def build(self, node):
10813 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
10814 if nodeName_ == 'Hash':
10815 obj_ = HashType.factory()
10816 obj_.build(child_)
10817 self.Hash.append(obj_)
10818
10819
10820
10822 """The type attribute is meant to provide a general way of
10823 characterizing file type, through MAEC's FileType enumeration.
10824 Possible values: PE, JS, PDF, ZIP, TXT, ASM, DOC, DOCX, XLS,
10825 XLSX, PPT, PPTX, Other."""
10826 subclass = None
10827 superclass = None
10828 - def __init__(self, type_=None, TrID_Type=None, Discovery_Method=None):
10829 self.type_ = _cast(None, type_)
10830 self.TrID_Type = TrID_Type
10831 self.Discovery_Method = Discovery_Method
10837 factory = staticmethod(factory)
10839 - def set_TrID_Type(self, TrID_Type): self.TrID_Type = TrID_Type
10842 - def get_type(self): return self.type_
10843 - def set_type(self, type_): self.type_ = type_
10844 - def export(self, outfile, level, namespace_='maec:', name_='File_TypeType', namespacedef_=''):
10845 showIndent(outfile, level)
10846 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
10847 already_processed = []
10848 self.exportAttributes(outfile, level, already_processed, namespace_, name_='File_TypeType')
10849 if self.hasContent_():
10850 outfile.write('>\n')
10851 self.exportChildren(outfile, level + 1, namespace_, name_)
10852 showIndent(outfile, level)
10853 outfile.write('</%s%s>\n' % (namespace_, name_))
10854 else:
10855 outfile.write('/>\n')
10856 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='File_TypeType'):
10857 if self.type_ is not None and 'type_' not in already_processed:
10858 already_processed.append('type_')
10859 outfile.write(' type=%s' % (quote_attrib(self.type_), ))
10860 - def exportChildren(self, outfile, level, namespace_='maec:', name_='File_TypeType', fromsubclass_=False):
10861 if self.TrID_Type is not None:
10862 self.TrID_Type.export(outfile, level, namespace_, name_='TrID_Type')
10863 if self.Discovery_Method is not None:
10864 self.Discovery_Method.export(outfile, level, namespace_, name_='Discovery_Method')
10865 - def hasContent_(self):
10866 if (
10867 self.TrID_Type is not None or
10868 self.Discovery_Method is not None
10869 ):
10870 return True
10871 else:
10872 return False
10873 - def exportLiteral(self, outfile, level, name_='File_TypeType'):
10879 if self.type_ is not None and 'type_' not in already_processed:
10880 already_processed.append('type_')
10881 showIndent(outfile, level)
10882 outfile.write('type_ = %s,\n' % (self.type_,))
10884 if self.TrID_Type is not None:
10885 showIndent(outfile, level)
10886 outfile.write('TrID_Type=model_.TrID_TypeType(\n')
10887 self.TrID_Type.exportLiteral(outfile, level, name_='TrID_Type')
10888 showIndent(outfile, level)
10889 outfile.write('),\n')
10890 if self.Discovery_Method is not None:
10891 showIndent(outfile, level)
10892 outfile.write('Discovery_Method=model_.DiscoveryMethod(\n')
10893 self.Discovery_Method.exportLiteral(outfile, level, name_='Discovery_Method')
10894 showIndent(outfile, level)
10895 outfile.write('),\n')
10896 - def build(self, node):
10902 value = find_attr_value_('type', node)
10903 if value is not None and 'type' not in already_processed:
10904 already_processed.append('type')
10905 self.type_ = value
10906 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
10915
10916
10917
10919 subclass = None
10920 superclass = None
10921 - def __init__(self, TriD_ID=None, TRID_Confidence=None):
10922 self.TriD_ID = TriD_ID
10923 self.TRID_Confidence = TRID_Confidence
10929 factory = staticmethod(factory)
10931 - def set_TriD_ID(self, TriD_ID): self.TriD_ID = TriD_ID
10934 - def export(self, outfile, level, namespace_='maec:', name_='TrID_TypeType', namespacedef_=''):
10935 showIndent(outfile, level)
10936 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
10937 already_processed = []
10938 self.exportAttributes(outfile, level, already_processed, namespace_, name_='TrID_TypeType')
10939 if self.hasContent_():
10940 outfile.write('>\n')
10941 self.exportChildren(outfile, level + 1, namespace_, name_)
10942 showIndent(outfile, level)
10943 outfile.write('</%s%s>\n' % (namespace_, name_))
10944 else:
10945 outfile.write('/>\n')
10946 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='TrID_TypeType'):
10948 - def exportChildren(self, outfile, level, namespace_='maec:', name_='TrID_TypeType', fromsubclass_=False):
10949 if self.TriD_ID is not None:
10950 showIndent(outfile, level)
10951 outfile.write('<%sTriD_ID>%s</%sTriD_ID>\n' % (namespace_, self.gds_format_string(quote_xml(self.TriD_ID).encode(ExternalEncoding), input_name='TriD_ID'), namespace_))
10952 if self.TRID_Confidence is not None:
10953 showIndent(outfile, level)
10954 outfile.write('<%sTRID_Confidence>%s</%sTRID_Confidence>\n' % (namespace_, self.gds_format_float(self.TRID_Confidence, input_name='TRID_Confidence'), namespace_))
10955 - def hasContent_(self):
10956 if (
10957 self.TriD_ID is not None or
10958 self.TRID_Confidence is not None
10959 ):
10960 return True
10961 else:
10962 return False
10963 - def exportLiteral(self, outfile, level, name_='TrID_TypeType'):
10971 if self.TriD_ID is not None:
10972 showIndent(outfile, level)
10973 outfile.write('TriD_ID=%s,\n' % quote_python(self.TriD_ID).encode(ExternalEncoding))
10974 if self.TRID_Confidence is not None:
10975 showIndent(outfile, level)
10976 outfile.write('TRID_Confidence=%f,\n' % self.TRID_Confidence)
10977 - def build(self, node):
10984 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
10985 if nodeName_ == 'TriD_ID':
10986 TriD_ID_ = child_.text
10987 TriD_ID_ = self.gds_validate_string(TriD_ID_, node, 'TriD_ID')
10988 self.TriD_ID = TriD_ID_
10989 elif nodeName_ == 'TRID_Confidence':
10990 sval_ = child_.text
10991 try:
10992 fval_ = float(sval_)
10993 except (TypeError, ValueError) as e:
10994 raise_parse_error(child_, 'requires float or double: %s' % e)
10995 fval_ = self.gds_validate_float(fval_, node, 'TRID_Confidence')
10996 self.TRID_Confidence = fval_
10997
10998
10999
11001 """The is_packed attribute is used to indicate whether the file system
11002 object is packed or not."""
11003 subclass = None
11004 superclass = None
11005 - def __init__(self, is_packed=None, Packer_Type=None):
11006 self.is_packed = _cast(bool, is_packed)
11007 if Packer_Type is None:
11008 self.Packer_Type = []
11009 else:
11010 self.Packer_Type = Packer_Type
11016 factory = staticmethod(factory)
11022 - def set_is_packed(self, is_packed): self.is_packed = is_packed
11023 - def export(self, outfile, level, namespace_='maec:', name_='PackingType', namespacedef_=''):
11024 showIndent(outfile, level)
11025 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
11026 already_processed = []
11027 self.exportAttributes(outfile, level, already_processed, namespace_, name_='PackingType')
11028 if self.hasContent_():
11029 outfile.write('>\n')
11030 self.exportChildren(outfile, level + 1, namespace_, name_)
11031 showIndent(outfile, level)
11032 outfile.write('</%s%s>\n' % (namespace_, name_))
11033 else:
11034 outfile.write('/>\n')
11035 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='PackingType'):
11036 if self.is_packed is not None and 'is_packed' not in already_processed:
11037 already_processed.append('is_packed')
11038 outfile.write(' is_packed="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.is_packed)), input_name='is_packed'))
11039 - def exportChildren(self, outfile, level, namespace_='maec:', name_='PackingType', fromsubclass_=False):
11040 for Packer_Type_ in self.Packer_Type:
11041 Packer_Type_.export(outfile, level, namespace_, name_='Packer_Type')
11042 - def hasContent_(self):
11043 if (
11044 self.Packer_Type
11045 ):
11046 return True
11047 else:
11048 return False
11055 if self.is_packed is not None and 'is_packed' not in already_processed:
11056 already_processed.append('is_packed')
11057 showIndent(outfile, level)
11058 outfile.write('is_packed = %s,\n' % (self.is_packed,))
11060 showIndent(outfile, level)
11061 outfile.write('Packer_Type=[\n')
11062 level += 1
11063 for Packer_Type_ in self.Packer_Type:
11064 showIndent(outfile, level)
11065 outfile.write('model_.Packer_TypeType(\n')
11066 Packer_Type_.exportLiteral(outfile, level, name_='Packer_TypeType')
11067 showIndent(outfile, level)
11068 outfile.write('),\n')
11069 level -= 1
11070 showIndent(outfile, level)
11071 outfile.write('],\n')
11072 - def build(self, node):
11078 value = find_attr_value_('is_packed', node)
11079 if value is not None and 'is_packed' not in already_processed:
11080 already_processed.append('is_packed')
11081 if value in ('true', '1'):
11082 self.is_packed = True
11083 elif value in ('false', '0'):
11084 self.is_packed = False
11085 else:
11086 raise_parse_error(node, 'Bad boolean attribute')
11087 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
11088 if nodeName_ == 'Packer_Type':
11089 obj_ = Packer_TypeType.factory()
11090 obj_.build(child_)
11091 self.Packer_Type.append(obj_)
11092
11093
11094
11096 """This is intended to characterize the type of packer characterized in
11097 this element. Possible values: Archiver, Installer, Self-
11098 Extracting_Archiver, Crypter, Packer, Protector, Bundler, Other."""
11099 subclass = None
11100 superclass = None
11101 - def __init__(self, type_=None, id=None, Name=None, Version=None, Discovery_Method=None):
11102 self.type_ = _cast(None, type_)
11103 self.id = _cast(None, id)
11104 self.Name = Name
11105 self.Version = Version
11106 self.Discovery_Method = Discovery_Method
11112 factory = staticmethod(factory)
11114 - def set_Name(self, Name): self.Name = Name
11116 - def set_Version(self, Version): self.Version = Version
11119 - def get_type(self): return self.type_
11120 - def set_type(self, type_): self.type_ = type_
11123 - def export(self, outfile, level, namespace_='maec:', name_='Packer_TypeType', namespacedef_=''):
11124 showIndent(outfile, level)
11125 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
11126 already_processed = []
11127 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Packer_TypeType')
11128 if self.hasContent_():
11129 outfile.write('>\n')
11130 self.exportChildren(outfile, level + 1, namespace_, name_)
11131 showIndent(outfile, level)
11132 outfile.write('</%s%s>\n' % (namespace_, name_))
11133 else:
11134 outfile.write('/>\n')
11135 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Packer_TypeType'):
11136 if self.type_ is not None and 'type_' not in already_processed:
11137 already_processed.append('type_')
11138 outfile.write(' type=%s' % (quote_attrib(self.type_), ))
11139 if self.id is not None and 'id' not in already_processed:
11140 already_processed.append('id')
11141 outfile.write(' id=%s' % (self.gds_format_string(quote_attrib(self.id).encode(ExternalEncoding), input_name='id'), ))
11142 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Packer_TypeType', fromsubclass_=False):
11143 if self.Name is not None:
11144 showIndent(outfile, level)
11145 outfile.write('<%sName>%s</%sName>\n' % (namespace_, self.gds_format_string(quote_xml(self.Name).encode(ExternalEncoding), input_name='Name'), namespace_))
11146 if self.Version is not None:
11147 showIndent(outfile, level)
11148 outfile.write('<%sVersion>%s</%sVersion>\n' % (namespace_, self.gds_format_string(quote_xml(self.Version).encode(ExternalEncoding), input_name='Version'), namespace_))
11149 if self.Discovery_Method is not None:
11150 self.Discovery_Method.export(outfile, level, namespace_, name_='Discovery_Method')
11151 - def hasContent_(self):
11152 if (
11153 self.Name is not None or
11154 self.Version is not None or
11155 self.Discovery_Method is not None
11156 ):
11157 return True
11158 else:
11159 return False
11160 - def exportLiteral(self, outfile, level, name_='Packer_TypeType'):
11166 if self.type_ is not None and 'type_' not in already_processed:
11167 already_processed.append('type_')
11168 showIndent(outfile, level)
11169 outfile.write('type_ = %s,\n' % (self.type_,))
11170 if self.id is not None and 'id' not in already_processed:
11171 already_processed.append('id')
11172 showIndent(outfile, level)
11173 outfile.write('id = "%s",\n' % (self.id,))
11175 if self.Name is not None:
11176 showIndent(outfile, level)
11177 outfile.write('Name=%s,\n' % quote_python(self.Name).encode(ExternalEncoding))
11178 if self.Version is not None:
11179 showIndent(outfile, level)
11180 outfile.write('Version=%s,\n' % quote_python(self.Version).encode(ExternalEncoding))
11181 if self.Discovery_Method is not None:
11182 showIndent(outfile, level)
11183 outfile.write('Discovery_Method=model_.DiscoveryMethod(\n')
11184 self.Discovery_Method.exportLiteral(outfile, level, name_='Discovery_Method')
11185 showIndent(outfile, level)
11186 outfile.write('),\n')
11187 - def build(self, node):
11193 value = find_attr_value_('type', node)
11194 if value is not None and 'type' not in already_processed:
11195 already_processed.append('type')
11196 self.type_ = value
11197 value = find_attr_value_('id', node)
11198 if value is not None and 'id' not in already_processed:
11199 already_processed.append('id')
11200 self.id = value
11201 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
11202 if nodeName_ == 'Name':
11203 Name_ = child_.text
11204 Name_ = self.gds_validate_string(Name_, node, 'Name')
11205 self.Name = Name_
11206 elif nodeName_ == 'Version':
11207 Version_ = child_.text
11208 Version_ = self.gds_validate_string(Version_, node, 'Version')
11209 self.Version = Version_
11210 elif nodeName_ == 'Discovery_Method':
11211 obj_ = DiscoveryMethod.factory()
11212 obj_.build(child_)
11213 self.set_Discovery_Method(obj_)
11214
11215
11216
11218 subclass = None
11219 superclass = None
11220 - def __init__(self, PE_Binary_Attributes=None):
11221 self.PE_Binary_Attributes = PE_Binary_Attributes
11227 factory = staticmethod(factory)
11230 - def export(self, outfile, level, namespace_='maec:', name_='File_Type_AttributesType', namespacedef_=''):
11231 showIndent(outfile, level)
11232 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
11233 already_processed = []
11234 self.exportAttributes(outfile, level, already_processed, namespace_, name_='File_Type_AttributesType')
11235 if self.hasContent_():
11236 outfile.write('>\n')
11237 self.exportChildren(outfile, level + 1, namespace_, name_)
11238 showIndent(outfile, level)
11239 outfile.write('</%s%s>\n' % (namespace_, name_))
11240 else:
11241 outfile.write('/>\n')
11242 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='File_Type_AttributesType'):
11244 - def exportChildren(self, outfile, level, namespace_='maec:', name_='File_Type_AttributesType', fromsubclass_=False):
11245 if self.PE_Binary_Attributes is not None:
11246 self.PE_Binary_Attributes.export(outfile, level, namespace_, name_='PE_Binary_Attributes')
11247 - def hasContent_(self):
11248 if (
11249 self.PE_Binary_Attributes is not None
11250 ):
11251 return True
11252 else:
11253 return False
11254 - def exportLiteral(self, outfile, level, name_='File_Type_AttributesType'):
11262 if self.PE_Binary_Attributes is not None:
11263 showIndent(outfile, level)
11264 outfile.write('PE_Binary_Attributes=model_.PE_Binary_AttributesType(\n')
11265 self.PE_Binary_Attributes.exportLiteral(outfile, level, name_='PE_Binary_Attributes')
11266 showIndent(outfile, level)
11267 outfile.write('),\n')
11268 - def build(self, node):
11275 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
11280
11281
11282
11284 """The type attribute is used to define the type of PE file being
11285 characterized. Possible values: EXE, DLL.The dll_count attribute
11286 is used to define the number of DLLs loaded by a PE file."""
11287 subclass = None
11288 superclass = None
11289 - def __init__(self, dll_count=None, type_=None, Version_Block=None, Headers=None, Strings=None, Imports=None, Exports=None, Resources=None, Sections=None, Digital_Certificates=None):
11290 self.dll_count = _cast(int, dll_count)
11291 self.type_ = _cast(None, type_)
11292 self.Version_Block = Version_Block
11293 self.Headers = Headers
11294 self.Strings = Strings
11295 self.Imports = Imports
11296 self.Exports = Exports
11297 self.Resources = Resources
11298 self.Sections = Sections
11299 self.Digital_Certificates = Digital_Certificates
11305 factory = staticmethod(factory)
11313 - def set_Imports(self, Imports): self.Imports = Imports
11315 - def set_Exports(self, Exports): self.Exports = Exports
11317 - def set_Resources(self, Resources): self.Resources = Resources
11319 - def set_Sections(self, Sections): self.Sections = Sections
11323 - def set_dll_count(self, dll_count): self.dll_count = dll_count
11324 - def get_type(self): return self.type_
11325 - def set_type(self, type_): self.type_ = type_
11326 - def export(self, outfile, level, namespace_='maec:', name_='PE_Binary_AttributesType', namespacedef_=''):
11327 showIndent(outfile, level)
11328 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
11329 already_processed = []
11330 self.exportAttributes(outfile, level, already_processed, namespace_, name_='PE_Binary_AttributesType')
11331 if self.hasContent_():
11332 outfile.write('>\n')
11333 self.exportChildren(outfile, level + 1, namespace_, name_)
11334 showIndent(outfile, level)
11335 outfile.write('</%s%s>\n' % (namespace_, name_))
11336 else:
11337 outfile.write('/>\n')
11338 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='PE_Binary_AttributesType'):
11339 if self.dll_count is not None and 'dll_count' not in already_processed:
11340 already_processed.append('dll_count')
11341 outfile.write(' dll_count="%s"' % self.gds_format_integer(self.dll_count, input_name='dll_count'))
11342 if self.type_ is not None and 'type_' not in already_processed:
11343 already_processed.append('type_')
11344 outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))
11345 - def exportChildren(self, outfile, level, namespace_='maec:', name_='PE_Binary_AttributesType', fromsubclass_=False):
11346 if self.Version_Block is not None:
11347 self.Version_Block.export(outfile, level, namespace_, name_='Version_Block')
11348 if self.Headers is not None:
11349 self.Headers.export(outfile, level, namespace_, name_='Headers')
11350 if self.Strings is not None:
11351 self.Strings.export(outfile, level, namespace_, name_='Strings')
11352 if self.Imports is not None:
11353 self.Imports.export(outfile, level, namespace_, name_='Imports')
11354 if self.Exports is not None:
11355 self.Exports.export(outfile, level, namespace_, name_='Exports')
11356 if self.Resources is not None:
11357 self.Resources.export(outfile, level, namespace_, name_='Resources')
11358 if self.Sections is not None:
11359 self.Sections.export(outfile, level, namespace_, name_='Sections')
11360 if self.Digital_Certificates is not None:
11361 self.Digital_Certificates.export(outfile, level, namespace_, name_='Digital_Certificates')
11362 - def hasContent_(self):
11363 if (
11364 self.Version_Block is not None or
11365 self.Headers is not None or
11366 self.Strings is not None or
11367 self.Imports is not None or
11368 self.Exports is not None or
11369 self.Resources is not None or
11370 self.Sections is not None or
11371 self.Digital_Certificates is not None
11372 ):
11373 return True
11374 else:
11375 return False
11376 - def exportLiteral(self, outfile, level, name_='PE_Binary_AttributesType'):
11382 if self.dll_count is not None and 'dll_count' not in already_processed:
11383 already_processed.append('dll_count')
11384 showIndent(outfile, level)
11385 outfile.write('dll_count = %d,\n' % (self.dll_count,))
11386 if self.type_ is not None and 'type_' not in already_processed:
11387 already_processed.append('type_')
11388 showIndent(outfile, level)
11389 outfile.write('type_ = "%s",\n' % (self.type_,))
11391 if self.Version_Block is not None:
11392 showIndent(outfile, level)
11393 outfile.write('Version_Block=model_.Version_BlockType(\n')
11394 self.Version_Block.exportLiteral(outfile, level, name_='Version_Block')
11395 showIndent(outfile, level)
11396 outfile.write('),\n')
11397 if self.Headers is not None:
11398 showIndent(outfile, level)
11399 outfile.write('Headers=model_.HeadersType(\n')
11400 self.Headers.exportLiteral(outfile, level, name_='Headers')
11401 showIndent(outfile, level)
11402 outfile.write('),\n')
11403 if self.Strings is not None:
11404 showIndent(outfile, level)
11405 outfile.write('Strings=model_.StringsType(\n')
11406 self.Strings.exportLiteral(outfile, level, name_='Strings')
11407 showIndent(outfile, level)
11408 outfile.write('),\n')
11409 if self.Imports is not None:
11410 showIndent(outfile, level)
11411 outfile.write('Imports=model_.ImportsType(\n')
11412 self.Imports.exportLiteral(outfile, level, name_='Imports')
11413 showIndent(outfile, level)
11414 outfile.write('),\n')
11415 if self.Exports is not None:
11416 showIndent(outfile, level)
11417 outfile.write('Exports=model_.ExportsType(\n')
11418 self.Exports.exportLiteral(outfile, level, name_='Exports')
11419 showIndent(outfile, level)
11420 outfile.write('),\n')
11421 if self.Resources is not None:
11422 showIndent(outfile, level)
11423 outfile.write('Resources=model_.ResourcesType(\n')
11424 self.Resources.exportLiteral(outfile, level, name_='Resources')
11425 showIndent(outfile, level)
11426 outfile.write('),\n')
11427 if self.Sections is not None:
11428 showIndent(outfile, level)
11429 outfile.write('Sections=model_.SectionsType(\n')
11430 self.Sections.exportLiteral(outfile, level, name_='Sections')
11431 showIndent(outfile, level)
11432 outfile.write('),\n')
11433 if self.Digital_Certificates is not None:
11434 showIndent(outfile, level)
11435 outfile.write('Digital_Certificates=model_.Digital_CertificatesType(\n')
11436 self.Digital_Certificates.exportLiteral(outfile, level, name_='Digital_Certificates')
11437 showIndent(outfile, level)
11438 outfile.write('),\n')
11439 - def build(self, node):
11445 value = find_attr_value_('dll_count', node)
11446 if value is not None and 'dll_count' not in already_processed:
11447 already_processed.append('dll_count')
11448 try:
11449 self.dll_count = int(value)
11450 except ValueError as e:
11451 raise_parse_error(node, 'Bad integer attribute: %s' % e)
11452 value = find_attr_value_('type', node)
11453 if value is not None and 'type' not in already_processed:
11454 already_processed.append('type')
11455 self.type_ = value
11456 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
11489
11490
11491
11493 subclass = None
11494 superclass = None
11495 - def __init__(self, Internal_Name=None, Product_Name=None, Company_Name=None, Legal_Copyright=None, Product_Version_Text=None, File_Description=None, File_Version_Text=None, Original_File_Name=None):
11496 self.Internal_Name = Internal_Name
11497 self.Product_Name = Product_Name
11498 self.Company_Name = Company_Name
11499 self.Legal_Copyright = Legal_Copyright
11500 self.Product_Version_Text = Product_Version_Text
11501 self.File_Description = File_Description
11502 self.File_Version_Text = File_Version_Text
11503 self.Original_File_Name = Original_File_Name
11509 factory = staticmethod(factory)
11518 - def get_Product_Version_Text(self): return self.Product_Version_Text
11519 - def set_Product_Version_Text(self, Product_Version_Text): self.Product_Version_Text = Product_Version_Text
11522 - def get_File_Version_Text(self): return self.File_Version_Text
11523 - def set_File_Version_Text(self, File_Version_Text): self.File_Version_Text = File_Version_Text
11526 - def export(self, outfile, level, namespace_='maec:', name_='Version_BlockType', namespacedef_=''):
11527 showIndent(outfile, level)
11528 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
11529 already_processed = []
11530 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Version_BlockType')
11531 if self.hasContent_():
11532 outfile.write('>\n')
11533 self.exportChildren(outfile, level + 1, namespace_, name_)
11534 showIndent(outfile, level)
11535 outfile.write('</%s%s>\n' % (namespace_, name_))
11536 else:
11537 outfile.write('/>\n')
11538 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Version_BlockType'):
11540 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Version_BlockType', fromsubclass_=False):
11541 if self.Internal_Name is not None:
11542 showIndent(outfile, level)
11543 outfile.write('<%sInternal_Name>%s</%sInternal_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.Internal_Name).encode(ExternalEncoding), input_name='Internal_Name'), namespace_))
11544 if self.Product_Name is not None:
11545 showIndent(outfile, level)
11546 outfile.write('<%sProduct_Name>%s</%sProduct_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.Product_Name).encode(ExternalEncoding), input_name='Product_Name'), namespace_))
11547 if self.Company_Name is not None:
11548 showIndent(outfile, level)
11549 outfile.write('<%sCompany_Name>%s</%sCompany_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.Company_Name).encode(ExternalEncoding), input_name='Company_Name'), namespace_))
11550 if self.Legal_Copyright is not None:
11551 showIndent(outfile, level)
11552 outfile.write('<%sLegal_Copyright>%s</%sLegal_Copyright>\n' % (namespace_, self.gds_format_string(quote_xml(self.Legal_Copyright).encode(ExternalEncoding), input_name='Legal_Copyright'), namespace_))
11553 if self.Product_Version_Text is not None:
11554 showIndent(outfile, level)
11555 outfile.write('<%sProduct_Version_Text>%s</%sProduct_Version_Text>\n' % (namespace_, self.gds_format_string(quote_xml(self.Product_Version_Text).encode(ExternalEncoding), input_name='Product_Version_Text'), namespace_))
11556 if self.File_Description is not None:
11557 showIndent(outfile, level)
11558 outfile.write('<%sFile_Description>%s</%sFile_Description>\n' % (namespace_, self.gds_format_string(quote_xml(self.File_Description).encode(ExternalEncoding), input_name='File_Description'), namespace_))
11559 if self.File_Version_Text is not None:
11560 showIndent(outfile, level)
11561 outfile.write('<%sFile_Version_Text>%s</%sFile_Version_Text>\n' % (namespace_, self.gds_format_string(quote_xml(self.File_Version_Text).encode(ExternalEncoding), input_name='File_Version_Text'), namespace_))
11562 if self.Original_File_Name is not None:
11563 showIndent(outfile, level)
11564 outfile.write('<%sOriginal_File_Name>%s</%sOriginal_File_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.Original_File_Name).encode(ExternalEncoding), input_name='Original_File_Name'), namespace_))
11565 - def hasContent_(self):
11566 if (
11567 self.Internal_Name is not None or
11568 self.Product_Name is not None or
11569 self.Company_Name is not None or
11570 self.Legal_Copyright is not None or
11571 self.Product_Version_Text is not None or
11572 self.File_Description is not None or
11573 self.File_Version_Text is not None or
11574 self.Original_File_Name is not None
11575 ):
11576 return True
11577 else:
11578 return False
11579 - def exportLiteral(self, outfile, level, name_='Version_BlockType'):
11587 if self.Internal_Name is not None:
11588 showIndent(outfile, level)
11589 outfile.write('Internal_Name=%s,\n' % quote_python(self.Internal_Name).encode(ExternalEncoding))
11590 if self.Product_Name is not None:
11591 showIndent(outfile, level)
11592 outfile.write('Product_Name=%s,\n' % quote_python(self.Product_Name).encode(ExternalEncoding))
11593 if self.Company_Name is not None:
11594 showIndent(outfile, level)
11595 outfile.write('Company_Name=%s,\n' % quote_python(self.Company_Name).encode(ExternalEncoding))
11596 if self.Legal_Copyright is not None:
11597 showIndent(outfile, level)
11598 outfile.write('Legal_Copyright=%s,\n' % quote_python(self.Legal_Copyright).encode(ExternalEncoding))
11599 if self.Product_Version_Text is not None:
11600 showIndent(outfile, level)
11601 outfile.write('Product_Version_Text=%s,\n' % quote_python(self.Product_Version_Text).encode(ExternalEncoding))
11602 if self.File_Description is not None:
11603 showIndent(outfile, level)
11604 outfile.write('File_Description=%s,\n' % quote_python(self.File_Description).encode(ExternalEncoding))
11605 if self.File_Version_Text is not None:
11606 showIndent(outfile, level)
11607 outfile.write('File_Version_Text=%s,\n' % quote_python(self.File_Version_Text).encode(ExternalEncoding))
11608 if self.Original_File_Name is not None:
11609 showIndent(outfile, level)
11610 outfile.write('Original_File_Name=%s,\n' % quote_python(self.Original_File_Name).encode(ExternalEncoding))
11611 - def build(self, node):
11618 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
11619 if nodeName_ == 'Internal_Name':
11620 Internal_Name_ = child_.text
11621 Internal_Name_ = self.gds_validate_string(Internal_Name_, node, 'Internal_Name')
11622 self.Internal_Name = Internal_Name_
11623 elif nodeName_ == 'Product_Name':
11624 Product_Name_ = child_.text
11625 Product_Name_ = self.gds_validate_string(Product_Name_, node, 'Product_Name')
11626 self.Product_Name = Product_Name_
11627 elif nodeName_ == 'Company_Name':
11628 Company_Name_ = child_.text
11629 Company_Name_ = self.gds_validate_string(Company_Name_, node, 'Company_Name')
11630 self.Company_Name = Company_Name_
11631 elif nodeName_ == 'Legal_Copyright':
11632 Legal_Copyright_ = child_.text
11633 Legal_Copyright_ = self.gds_validate_string(Legal_Copyright_, node, 'Legal_Copyright')
11634 self.Legal_Copyright = Legal_Copyright_
11635 elif nodeName_ == 'Product_Version_Text':
11636 Product_Version_Text_ = child_.text
11637 Product_Version_Text_ = self.gds_validate_string(Product_Version_Text_, node, 'Product_Version_Text')
11638 self.Product_Version_Text = Product_Version_Text_
11639 elif nodeName_ == 'File_Description':
11640 File_Description_ = child_.text
11641 File_Description_ = self.gds_validate_string(File_Description_, node, 'File_Description')
11642 self.File_Description = File_Description_
11643 elif nodeName_ == 'File_Version_Text':
11644 File_Version_Text_ = child_.text
11645 File_Version_Text_ = self.gds_validate_string(File_Version_Text_, node, 'File_Version_Text')
11646 self.File_Version_Text = File_Version_Text_
11647 elif nodeName_ == 'Original_File_Name':
11648 Original_File_Name_ = child_.text
11649 Original_File_Name_ = self.gds_validate_string(Original_File_Name_, node, 'Original_File_Name')
11650 self.Original_File_Name = Original_File_Name_
11651
11652
11653
11655 subclass = None
11656 superclass = None
11658 self.DOS_Header = DOS_Header
11659 self.PE_Header = PE_Header
11660 self.Section_Table = Section_Table
11666 factory = staticmethod(factory)
11674 showIndent(outfile, level)
11675 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
11676 already_processed = []
11677 self.exportAttributes(outfile, level, already_processed, namespace_, name_='HeadersType')
11678 if self.hasContent_():
11679 outfile.write('>\n')
11680 self.exportChildren(outfile, level + 1, namespace_, name_)
11681 showIndent(outfile, level)
11682 outfile.write('</%s%s>\n' % (namespace_, name_))
11683 else:
11684 outfile.write('/>\n')
11688 if self.DOS_Header is not None:
11689 self.DOS_Header.export(outfile, level, namespace_, name_='DOS_Header')
11690 if self.PE_Header is not None:
11691 self.PE_Header.export(outfile, level, namespace_, name_='PE_Header')
11692 if self.Section_Table is not None:
11693 self.Section_Table.export(outfile, level, namespace_, name_='Section_Table')
11695 if (
11696 self.DOS_Header is not None or
11697 self.PE_Header is not None or
11698 self.Section_Table is not None
11699 ):
11700 return True
11701 else:
11702 return False
11711 if self.DOS_Header is not None:
11712 showIndent(outfile, level)
11713 outfile.write('DOS_Header=model_.DOS_HeaderType(\n')
11714 self.DOS_Header.exportLiteral(outfile, level, name_='DOS_Header')
11715 showIndent(outfile, level)
11716 outfile.write('),\n')
11717 if self.PE_Header is not None:
11718 showIndent(outfile, level)
11719 outfile.write('PE_Header=model_.PE_HeaderType(\n')
11720 self.PE_Header.exportLiteral(outfile, level, name_='PE_Header')
11721 showIndent(outfile, level)
11722 outfile.write('),\n')
11723 if self.Section_Table is not None:
11724 showIndent(outfile, level)
11725 outfile.write('Section_Table=model_.Section_TableType(\n')
11726 self.Section_Table.exportLiteral(outfile, level, name_='Section_Table')
11727 showIndent(outfile, level)
11728 outfile.write('),\n')
11749
11750
11751
11753 subclass = None
11754 superclass = None
11756 self.Hashes = Hashes
11757 self.signature = signature
11758 self.lastsize = lastsize
11759 self.nblocks = nblocks
11760 self.nreloc = nreloc
11761 self.hdrsize = hdrsize
11762 self.minalloc = minalloc
11763 self.maxalloc = maxalloc
11764 self.checksum = checksum
11765 self.relocpos = relocpos
11766 self.noverlay = noverlay
11767 self.reserved1 = reserved1
11768 self.oem_id = oem_id
11769 self.oem_info = oem_info
11770 self.reserved2 = reserved2
11771 self.e_lfanew = e_lfanew
11777 factory = staticmethod(factory)
11811 showIndent(outfile, level)
11812 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
11813 already_processed = []
11814 self.exportAttributes(outfile, level, already_processed, namespace_, name_='DOS_HeaderType')
11815 if self.hasContent_():
11816 outfile.write('>\n')
11817 self.exportChildren(outfile, level + 1, namespace_, name_)
11818 showIndent(outfile, level)
11819 outfile.write('</%s%s>\n' % (namespace_, name_))
11820 else:
11821 outfile.write('/>\n')
11825 if self.Hashes is not None:
11826 self.Hashes.export(outfile, level, namespace_, name_='Hashes')
11827 if self.signature is not None:
11828 self.signature.export(outfile, level, namespace_, name_='signature')
11829 if self.lastsize is not None:
11830 self.lastsize.export(outfile, level, namespace_, name_='lastsize')
11831 if self.nblocks is not None:
11832 self.nblocks.export(outfile, level, namespace_, name_='nblocks')
11833 if self.nreloc is not None:
11834 self.nreloc.export(outfile, level, namespace_, name_='nreloc')
11835 if self.hdrsize is not None:
11836 self.hdrsize.export(outfile, level, namespace_, name_='hdrsize')
11837 if self.minalloc is not None:
11838 self.minalloc.export(outfile, level, namespace_, name_='minalloc')
11839 if self.maxalloc is not None:
11840 self.maxalloc.export(outfile, level, namespace_, name_='maxalloc')
11841 if self.checksum is not None:
11842 self.checksum.export(outfile, level, namespace_, name_='checksum')
11843 if self.relocpos is not None:
11844 self.relocpos.export(outfile, level, namespace_, name_='relocpos')
11845 if self.noverlay is not None:
11846 self.noverlay.export(outfile, level, namespace_, name_='noverlay')
11847 if self.reserved1 is not None:
11848 self.reserved1.export(outfile, level, namespace_, name_='reserved1')
11849 if self.oem_id is not None:
11850 self.oem_id.export(outfile, level, namespace_, name_='oem_id')
11851 if self.oem_info is not None:
11852 self.oem_info.export(outfile, level, namespace_, name_='oem_info')
11853 if self.reserved2 is not None:
11854 self.reserved2.export(outfile, level, namespace_, name_='reserved2')
11855 if self.e_lfanew is not None:
11856 self.e_lfanew.export(outfile, level, namespace_, name_='e_lfanew')
11858 if (
11859 self.Hashes is not None or
11860 self.signature is not None or
11861 self.lastsize is not None or
11862 self.nblocks is not None or
11863 self.nreloc is not None or
11864 self.hdrsize is not None or
11865 self.minalloc is not None or
11866 self.maxalloc is not None or
11867 self.checksum is not None or
11868 self.relocpos is not None or
11869 self.noverlay is not None or
11870 self.reserved1 is not None or
11871 self.oem_id is not None or
11872 self.oem_info is not None or
11873 self.reserved2 is not None or
11874 self.e_lfanew is not None
11875 ):
11876 return True
11877 else:
11878 return False
11887 if self.Hashes is not None:
11888 showIndent(outfile, level)
11889 outfile.write('Hashes=model_.HashesType1(\n')
11890 self.Hashes.exportLiteral(outfile, level, name_='Hashes')
11891 showIndent(outfile, level)
11892 outfile.write('),\n')
11893 if self.signature is not None:
11894 showIndent(outfile, level)
11895 outfile.write('signature=model_.xs_hexBinary(\n')
11896 self.signature.exportLiteral(outfile, level, name_='signature')
11897 showIndent(outfile, level)
11898 outfile.write('),\n')
11899 if self.lastsize is not None:
11900 showIndent(outfile, level)
11901 outfile.write('lastsize=model_.xs_hexBinary(\n')
11902 self.lastsize.exportLiteral(outfile, level, name_='lastsize')
11903 showIndent(outfile, level)
11904 outfile.write('),\n')
11905 if self.nblocks is not None:
11906 showIndent(outfile, level)
11907 outfile.write('nblocks=model_.xs_hexBinary(\n')
11908 self.nblocks.exportLiteral(outfile, level, name_='nblocks')
11909 showIndent(outfile, level)
11910 outfile.write('),\n')
11911 if self.nreloc is not None:
11912 showIndent(outfile, level)
11913 outfile.write('nreloc=model_.xs_hexBinary(\n')
11914 self.nreloc.exportLiteral(outfile, level, name_='nreloc')
11915 showIndent(outfile, level)
11916 outfile.write('),\n')
11917 if self.hdrsize is not None:
11918 showIndent(outfile, level)
11919 outfile.write('hdrsize=model_.xs_hexBinary(\n')
11920 self.hdrsize.exportLiteral(outfile, level, name_='hdrsize')
11921 showIndent(outfile, level)
11922 outfile.write('),\n')
11923 if self.minalloc is not None:
11924 showIndent(outfile, level)
11925 outfile.write('minalloc=model_.xs_hexBinary(\n')
11926 self.minalloc.exportLiteral(outfile, level, name_='minalloc')
11927 showIndent(outfile, level)
11928 outfile.write('),\n')
11929 if self.maxalloc is not None:
11930 showIndent(outfile, level)
11931 outfile.write('maxalloc=model_.xs_hexBinary(\n')
11932 self.maxalloc.exportLiteral(outfile, level, name_='maxalloc')
11933 showIndent(outfile, level)
11934 outfile.write('),\n')
11935 if self.checksum is not None:
11936 showIndent(outfile, level)
11937 outfile.write('checksum=model_.xs_hexBinary(\n')
11938 self.checksum.exportLiteral(outfile, level, name_='checksum')
11939 showIndent(outfile, level)
11940 outfile.write('),\n')
11941 if self.relocpos is not None:
11942 showIndent(outfile, level)
11943 outfile.write('relocpos=model_.xs_hexBinary(\n')
11944 self.relocpos.exportLiteral(outfile, level, name_='relocpos')
11945 showIndent(outfile, level)
11946 outfile.write('),\n')
11947 if self.noverlay is not None:
11948 showIndent(outfile, level)
11949 outfile.write('noverlay=model_.xs_hexBinary(\n')
11950 self.noverlay.exportLiteral(outfile, level, name_='noverlay')
11951 showIndent(outfile, level)
11952 outfile.write('),\n')
11953 if self.reserved1 is not None:
11954 showIndent(outfile, level)
11955 outfile.write('reserved1=model_.xs_hexBinary(\n')
11956 self.reserved1.exportLiteral(outfile, level, name_='reserved1')
11957 showIndent(outfile, level)
11958 outfile.write('),\n')
11959 if self.oem_id is not None:
11960 showIndent(outfile, level)
11961 outfile.write('oem_id=model_.xs_hexBinary(\n')
11962 self.oem_id.exportLiteral(outfile, level, name_='oem_id')
11963 showIndent(outfile, level)
11964 outfile.write('),\n')
11965 if self.oem_info is not None:
11966 showIndent(outfile, level)
11967 outfile.write('oem_info=model_.xs_hexBinary(\n')
11968 self.oem_info.exportLiteral(outfile, level, name_='oem_info')
11969 showIndent(outfile, level)
11970 outfile.write('),\n')
11971 if self.reserved2 is not None:
11972 showIndent(outfile, level)
11973 outfile.write('reserved2=model_.xs_hexBinary(\n')
11974 self.reserved2.exportLiteral(outfile, level, name_='reserved2')
11975 showIndent(outfile, level)
11976 outfile.write('),\n')
11977 if self.e_lfanew is not None:
11978 showIndent(outfile, level)
11979 outfile.write('e_lfanew=model_.xs_hexBinary(\n')
11980 self.e_lfanew.exportLiteral(outfile, level, name_='e_lfanew')
11981 showIndent(outfile, level)
11982 outfile.write('),\n')
11991 if nodeName_ == 'Hashes':
11992 obj_ = HashesType1.factory()
11993 obj_.build(child_)
11994 self.set_Hashes(obj_)
11995 elif nodeName_ == 'signature':
11996 obj_ = xs_hexBinary.factory()
11997 obj_.build(child_)
11998 self.set_signature(obj_)
11999 elif nodeName_ == 'lastsize':
12000 obj_ = xs_hexBinary.factory()
12001 obj_.build(child_)
12002 self.set_lastsize(obj_)
12003 elif nodeName_ == 'nblocks':
12004 obj_ = xs_hexBinary.factory()
12005 obj_.build(child_)
12006 self.set_nblocks(obj_)
12007 elif nodeName_ == 'nreloc':
12008 obj_ = xs_hexBinary.factory()
12009 obj_.build(child_)
12010 self.set_nreloc(obj_)
12011 elif nodeName_ == 'hdrsize':
12012 obj_ = xs_hexBinary.factory()
12013 obj_.build(child_)
12014 self.set_hdrsize(obj_)
12015 elif nodeName_ == 'minalloc':
12016 obj_ = xs_hexBinary.factory()
12017 obj_.build(child_)
12018 self.set_minalloc(obj_)
12019 elif nodeName_ == 'maxalloc':
12020 obj_ = xs_hexBinary.factory()
12021 obj_.build(child_)
12022 self.set_maxalloc(obj_)
12023 elif nodeName_ == 'checksum':
12024 obj_ = xs_hexBinary.factory()
12025 obj_.build(child_)
12026 self.set_checksum(obj_)
12027 elif nodeName_ == 'relocpos':
12028 obj_ = xs_hexBinary.factory()
12029 obj_.build(child_)
12030 self.set_relocpos(obj_)
12031 elif nodeName_ == 'noverlay':
12032 obj_ = xs_hexBinary.factory()
12033 obj_.build(child_)
12034 self.set_noverlay(obj_)
12035 elif nodeName_ == 'reserved1':
12036 obj_ = xs_hexBinary.factory()
12037 obj_.build(child_)
12038 self.set_reserved1(obj_)
12039 elif nodeName_ == 'oem_id':
12040 obj_ = xs_hexBinary.factory()
12041 obj_.build(child_)
12042 self.set_oem_id(obj_)
12043 elif nodeName_ == 'oem_info':
12044 obj_ = xs_hexBinary.factory()
12045 obj_.build(child_)
12046 self.set_oem_info(obj_)
12047 elif nodeName_ == 'reserved2':
12048 obj_ = xs_hexBinary.factory()
12049 obj_.build(child_)
12050 self.set_reserved2(obj_)
12051 elif nodeName_ == 'e_lfanew':
12052 obj_ = xs_hexBinary.factory()
12053 obj_.build(child_)
12054 self.set_e_lfanew(obj_)
12055
12056
12057
12059 subclass = None
12060 superclass = None
12062 if Hash is None:
12063 self.Hash = []
12064 else:
12065 self.Hash = Hash
12071 factory = staticmethod(factory)
12073 - def set_Hash(self, Hash): self.Hash = Hash
12074 - def add_Hash(self, value): self.Hash.append(value)
12075 - def insert_Hash(self, index, value): self.Hash[index] = value
12076 - def export(self, outfile, level, namespace_='maec:', name_='HashesType1', namespacedef_=''):
12077 showIndent(outfile, level)
12078 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
12079 already_processed = []
12080 self.exportAttributes(outfile, level, already_processed, namespace_, name_='HashesType1')
12081 if self.hasContent_():
12082 outfile.write('>\n')
12083 self.exportChildren(outfile, level + 1, namespace_, name_)
12084 showIndent(outfile, level)
12085 outfile.write('</%s%s>\n' % (namespace_, name_))
12086 else:
12087 outfile.write('/>\n')
12088 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='HashesType1'):
12090 - def exportChildren(self, outfile, level, namespace_='maec:', name_='HashesType1', fromsubclass_=False):
12091 for Hash_ in self.Hash:
12092 Hash_.export(outfile, level, namespace_, name_='Hash')
12093 - def hasContent_(self):
12094 if (
12095 self.Hash
12096 ):
12097 return True
12098 else:
12099 return False
12108 showIndent(outfile, level)
12109 outfile.write('Hash=[\n')
12110 level += 1
12111 for Hash_ in self.Hash:
12112 showIndent(outfile, level)
12113 outfile.write('model_.HashType(\n')
12114 Hash_.exportLiteral(outfile, level, name_='HashType')
12115 showIndent(outfile, level)
12116 outfile.write('),\n')
12117 level -= 1
12118 showIndent(outfile, level)
12119 outfile.write('],\n')
12120 - def build(self, node):
12127 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
12128 if nodeName_ == 'Hash':
12129 obj_ = HashType.factory()
12130 obj_.build(child_)
12131 self.Hash.append(obj_)
12132
12133
12134
12136 subclass = None
12137 superclass = None
12139 self.Hashes = Hashes
12140 self.Entropy = Entropy
12141 self.Signature = Signature
12142 self.File_Header = File_Header
12143 self.Optional_Header = Optional_Header
12149 factory = staticmethod(factory)
12161 showIndent(outfile, level)
12162 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
12163 already_processed = []
12164 self.exportAttributes(outfile, level, already_processed, namespace_, name_='PE_HeaderType')
12165 if self.hasContent_():
12166 outfile.write('>\n')
12167 self.exportChildren(outfile, level + 1, namespace_, name_)
12168 showIndent(outfile, level)
12169 outfile.write('</%s%s>\n' % (namespace_, name_))
12170 else:
12171 outfile.write('/>\n')
12175 if self.Hashes is not None:
12176 self.Hashes.export(outfile, level, namespace_, name_='Hashes')
12177 if self.Entropy is not None:
12178 showIndent(outfile, level)
12179 outfile.write('<%sEntropy>%s</%sEntropy>\n' % (namespace_, self.gds_format_float(self.Entropy, input_name='Entropy'), namespace_))
12180 if self.Signature is not None:
12181 self.Signature.export(outfile, level, namespace_, name_='Signature')
12182 if self.File_Header is not None:
12183 self.File_Header.export(outfile, level, namespace_, name_='File_Header')
12184 if self.Optional_Header is not None:
12185 self.Optional_Header.export(outfile, level, namespace_, name_='Optional_Header')
12187 if (
12188 self.Hashes is not None or
12189 self.Entropy is not None or
12190 self.Signature is not None or
12191 self.File_Header is not None or
12192 self.Optional_Header is not None
12193 ):
12194 return True
12195 else:
12196 return False
12205 if self.Hashes is not None:
12206 showIndent(outfile, level)
12207 outfile.write('Hashes=model_.HashesType2(\n')
12208 self.Hashes.exportLiteral(outfile, level, name_='Hashes')
12209 showIndent(outfile, level)
12210 outfile.write('),\n')
12211 if self.Entropy is not None:
12212 showIndent(outfile, level)
12213 outfile.write('Entropy=%f,\n' % self.Entropy)
12214 if self.Signature is not None:
12215 showIndent(outfile, level)
12216 outfile.write('Signature=model_.xs_hexBinary(\n')
12217 self.Signature.exportLiteral(outfile, level, name_='Signature')
12218 showIndent(outfile, level)
12219 outfile.write('),\n')
12220 if self.File_Header is not None:
12221 showIndent(outfile, level)
12222 outfile.write('File_Header=model_.File_HeaderType(\n')
12223 self.File_Header.exportLiteral(outfile, level, name_='File_Header')
12224 showIndent(outfile, level)
12225 outfile.write('),\n')
12226 if self.Optional_Header is not None:
12227 showIndent(outfile, level)
12228 outfile.write('Optional_Header=model_.Optional_HeaderType(\n')
12229 self.Optional_Header.exportLiteral(outfile, level, name_='Optional_Header')
12230 showIndent(outfile, level)
12231 outfile.write('),\n')
12264
12265
12266
12268 subclass = None
12269 superclass = None
12271 if Hash is None:
12272 self.Hash = []
12273 else:
12274 self.Hash = Hash
12280 factory = staticmethod(factory)
12282 - def set_Hash(self, Hash): self.Hash = Hash
12283 - def add_Hash(self, value): self.Hash.append(value)
12284 - def insert_Hash(self, index, value): self.Hash[index] = value
12285 - def export(self, outfile, level, namespace_='maec:', name_='HashesType2', namespacedef_=''):
12286 showIndent(outfile, level)
12287 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
12288 already_processed = []
12289 self.exportAttributes(outfile, level, already_processed, namespace_, name_='HashesType2')
12290 if self.hasContent_():
12291 outfile.write('>\n')
12292 self.exportChildren(outfile, level + 1, namespace_, name_)
12293 showIndent(outfile, level)
12294 outfile.write('</%s%s>\n' % (namespace_, name_))
12295 else:
12296 outfile.write('/>\n')
12297 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='HashesType2'):
12299 - def exportChildren(self, outfile, level, namespace_='maec:', name_='HashesType2', fromsubclass_=False):
12300 for Hash_ in self.Hash:
12301 Hash_.export(outfile, level, namespace_, name_='Hash')
12302 - def hasContent_(self):
12303 if (
12304 self.Hash
12305 ):
12306 return True
12307 else:
12308 return False
12317 showIndent(outfile, level)
12318 outfile.write('Hash=[\n')
12319 level += 1
12320 for Hash_ in self.Hash:
12321 showIndent(outfile, level)
12322 outfile.write('model_.HashType(\n')
12323 Hash_.exportLiteral(outfile, level, name_='HashType')
12324 showIndent(outfile, level)
12325 outfile.write('),\n')
12326 level -= 1
12327 showIndent(outfile, level)
12328 outfile.write('],\n')
12329 - def build(self, node):
12336 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
12337 if nodeName_ == 'Hash':
12338 obj_ = HashType.factory()
12339 obj_.build(child_)
12340 self.Hash.append(obj_)
12341
12342
12343
12345 subclass = None
12346 superclass = None
12348 self.Hashes = Hashes
12349 self.Machine = Machine
12350 self.Number_Of_Sections = Number_Of_Sections
12351 self.Time_Date_Stamp = Time_Date_Stamp
12352 self.Pointer_To_Symbol_Table = Pointer_To_Symbol_Table
12353 self.Number_Of_Symbols = Number_Of_Symbols
12354 self.Size_Of_Optional_Header = Size_Of_Optional_Header
12355 self.Characteristics = Characteristics
12361 factory = staticmethod(factory)
12379 showIndent(outfile, level)
12380 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
12381 already_processed = []
12382 self.exportAttributes(outfile, level, already_processed, namespace_, name_='File_HeaderType')
12383 if self.hasContent_():
12384 outfile.write('>\n')
12385 self.exportChildren(outfile, level + 1, namespace_, name_)
12386 showIndent(outfile, level)
12387 outfile.write('</%s%s>\n' % (namespace_, name_))
12388 else:
12389 outfile.write('/>\n')
12393 if self.Hashes is not None:
12394 self.Hashes.export(outfile, level, namespace_, name_='Hashes')
12395 if self.Machine is not None:
12396 self.Machine.export(outfile, level, namespace_, name_='Machine')
12397 if self.Number_Of_Sections is not None:
12398 showIndent(outfile, level)
12399 outfile.write('<%sNumber_Of_Sections>%s</%sNumber_Of_Sections>\n' % (namespace_, self.gds_format_integer(self.Number_Of_Sections, input_name='Number_Of_Sections'), namespace_))
12400 if self.Time_Date_Stamp is not None:
12401 self.Time_Date_Stamp.export(outfile, level, namespace_, name_='Time_Date_Stamp')
12402 if self.Pointer_To_Symbol_Table is not None:
12403 self.Pointer_To_Symbol_Table.export(outfile, level, namespace_, name_='Pointer_To_Symbol_Table')
12404 if self.Number_Of_Symbols is not None:
12405 showIndent(outfile, level)
12406 outfile.write('<%sNumber_Of_Symbols>%s</%sNumber_Of_Symbols>\n' % (namespace_, self.gds_format_integer(self.Number_Of_Symbols, input_name='Number_Of_Symbols'), namespace_))
12407 if self.Size_Of_Optional_Header is not None:
12408 self.Size_Of_Optional_Header.export(outfile, level, namespace_, name_='Size_Of_Optional_Header')
12409 if self.Characteristics is not None:
12410 self.Characteristics.export(outfile, level, namespace_, name_='Characteristics')
12412 if (
12413 self.Hashes is not None or
12414 self.Machine is not None or
12415 self.Number_Of_Sections is not None or
12416 self.Time_Date_Stamp is not None or
12417 self.Pointer_To_Symbol_Table is not None or
12418 self.Number_Of_Symbols is not None or
12419 self.Size_Of_Optional_Header is not None or
12420 self.Characteristics is not None
12421 ):
12422 return True
12423 else:
12424 return False
12433 if self.Hashes is not None:
12434 showIndent(outfile, level)
12435 outfile.write('Hashes=model_.HashesType3(\n')
12436 self.Hashes.exportLiteral(outfile, level, name_='Hashes')
12437 showIndent(outfile, level)
12438 outfile.write('),\n')
12439 if self.Machine is not None:
12440 showIndent(outfile, level)
12441 outfile.write('Machine=model_.xs_hexBinary(\n')
12442 self.Machine.exportLiteral(outfile, level, name_='Machine')
12443 showIndent(outfile, level)
12444 outfile.write('),\n')
12445 if self.Number_Of_Sections is not None:
12446 showIndent(outfile, level)
12447 outfile.write('Number_Of_Sections=%d,\n' % self.Number_Of_Sections)
12448 if self.Time_Date_Stamp is not None:
12449 showIndent(outfile, level)
12450 outfile.write('Time_Date_Stamp=model_.xs_hexBinary(\n')
12451 self.Time_Date_Stamp.exportLiteral(outfile, level, name_='Time_Date_Stamp')
12452 showIndent(outfile, level)
12453 outfile.write('),\n')
12454 if self.Pointer_To_Symbol_Table is not None:
12455 showIndent(outfile, level)
12456 outfile.write('Pointer_To_Symbol_Table=model_.xs_hexBinary(\n')
12457 self.Pointer_To_Symbol_Table.exportLiteral(outfile, level, name_='Pointer_To_Symbol_Table')
12458 showIndent(outfile, level)
12459 outfile.write('),\n')
12460 if self.Number_Of_Symbols is not None:
12461 showIndent(outfile, level)
12462 outfile.write('Number_Of_Symbols=%d,\n' % self.Number_Of_Symbols)
12463 if self.Size_Of_Optional_Header is not None:
12464 showIndent(outfile, level)
12465 outfile.write('Size_Of_Optional_Header=model_.xs_hexBinary(\n')
12466 self.Size_Of_Optional_Header.exportLiteral(outfile, level, name_='Size_Of_Optional_Header')
12467 showIndent(outfile, level)
12468 outfile.write('),\n')
12469 if self.Characteristics is not None:
12470 showIndent(outfile, level)
12471 outfile.write('Characteristics=model_.xs_hexBinary(\n')
12472 self.Characteristics.exportLiteral(outfile, level, name_='Characteristics')
12473 showIndent(outfile, level)
12474 outfile.write('),\n')
12483 if nodeName_ == 'Hashes':
12484 obj_ = HashesType3.factory()
12485 obj_.build(child_)
12486 self.set_Hashes(obj_)
12487 elif nodeName_ == 'Machine':
12488 obj_ = xs_hexBinary.factory()
12489 obj_.build(child_)
12490 self.set_Machine(obj_)
12491 elif nodeName_ == 'Number_Of_Sections':
12492 sval_ = child_.text
12493 try:
12494 ival_ = int(sval_)
12495 except (TypeError, ValueError), exp:
12496 raise_parse_error(child_, 'requires integer: %s' % exp)
12497 ival_ = self.gds_validate_integer(ival_, node, 'Number_Of_Sections')
12498 self.Number_Of_Sections = ival_
12499 elif nodeName_ == 'Time_Date_Stamp':
12500 obj_ = xs_hexBinary.factory()
12501 obj_.build(child_)
12502 self.set_Time_Date_Stamp(obj_)
12503 elif nodeName_ == 'Pointer_To_Symbol_Table':
12504 obj_ = xs_hexBinary.factory()
12505 obj_.build(child_)
12506 self.set_Pointer_To_Symbol_Table(obj_)
12507 elif nodeName_ == 'Number_Of_Symbols':
12508 sval_ = child_.text
12509 try:
12510 ival_ = int(sval_)
12511 except (TypeError, ValueError) as e:
12512 raise_parse_error(child_, 'requires integer: %s' % e)
12513 ival_ = self.gds_validate_integer(ival_, node, 'Number_Of_Symbols')
12514 self.Number_Of_Symbols = ival_
12515 elif nodeName_ == 'Size_Of_Optional_Header':
12516 obj_ = xs_hexBinary.factory()
12517 obj_.build(child_)
12518 self.set_Size_Of_Optional_Header(obj_)
12519 elif nodeName_ == 'Characteristics':
12520 obj_ = xs_hexBinary.factory()
12521 obj_.build(child_)
12522 self.set_Characteristics(obj_)
12523
12524
12525
12527 subclass = None
12528 superclass = None
12530 if Hash is None:
12531 self.Hash = []
12532 else:
12533 self.Hash = Hash
12539 factory = staticmethod(factory)
12541 - def set_Hash(self, Hash): self.Hash = Hash
12542 - def add_Hash(self, value): self.Hash.append(value)
12543 - def insert_Hash(self, index, value): self.Hash[index] = value
12544 - def export(self, outfile, level, namespace_='maec:', name_='HashesType3', namespacedef_=''):
12545 showIndent(outfile, level)
12546 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
12547 already_processed = []
12548 self.exportAttributes(outfile, level, already_processed, namespace_, name_='HashesType3')
12549 if self.hasContent_():
12550 outfile.write('>\n')
12551 self.exportChildren(outfile, level + 1, namespace_, name_)
12552 showIndent(outfile, level)
12553 outfile.write('</%s%s>\n' % (namespace_, name_))
12554 else:
12555 outfile.write('/>\n')
12556 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='HashesType3'):
12558 - def exportChildren(self, outfile, level, namespace_='maec:', name_='HashesType3', fromsubclass_=False):
12559 for Hash_ in self.Hash:
12560 Hash_.export(outfile, level, namespace_, name_='Hash')
12561 - def hasContent_(self):
12562 if (
12563 self.Hash
12564 ):
12565 return True
12566 else:
12567 return False
12576 showIndent(outfile, level)
12577 outfile.write('Hash=[\n')
12578 level += 1
12579 for Hash_ in self.Hash:
12580 showIndent(outfile, level)
12581 outfile.write('model_.HashType(\n')
12582 Hash_.exportLiteral(outfile, level, name_='HashType')
12583 showIndent(outfile, level)
12584 outfile.write('),\n')
12585 level -= 1
12586 showIndent(outfile, level)
12587 outfile.write('],\n')
12588 - def build(self, node):
12595 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
12596 if nodeName_ == 'Hash':
12597 obj_ = HashType.factory()
12598 obj_.build(child_)
12599 self.Hash.append(obj_)
12600
12601
12602
12604 subclass = None
12605 superclass = None
12607 self.Hashes = Hashes
12608 self.Major_Linker_Version = Major_Linker_Version
12609 self.Minor_Linker_Version = Minor_Linker_Version
12610 self.Size_Of_Code = Size_Of_Code
12611 self.Size_Of_Initialized_Data = Size_Of_Initialized_Data
12612 self.Size_Of_Uninitialized_Data = Size_Of_Uninitialized_Data
12613 self.Address_Of_Entry_Point = Address_Of_Entry_Point
12614 self.Base_Of_Code = Base_Of_Code
12615 self.Base_Of_Data = Base_Of_Data
12616 self.Image_Base = Image_Base
12617 self.Section_Alignment = Section_Alignment
12618 self.File_Alignment = File_Alignment
12619 self.Major_OS_Version = Major_OS_Version
12620 self.Minor_OS_Version = Minor_OS_Version
12621 self.Major_Image_Version = Major_Image_Version
12622 self.Minor_Image_Version = Minor_Image_Version
12623 self.Major_Subsystem_Version = Major_Subsystem_Version
12624 self.Minor_Subsystem_Version = Minor_Subsystem_Version
12625 self.Reserved = Reserved
12626 self.Size_Of_Image = Size_Of_Image
12627 self.Size_Of_Headers = Size_Of_Headers
12628 self.Checksum = Checksum
12629 self.Subsystem = Subsystem
12630 self.DLL_Characteristics = DLL_Characteristics
12631 self.Size_Of_Stack_Reserve = Size_Of_Stack_Reserve
12632 self.Size_Of_Stack_Commit = Size_Of_Stack_Commit
12633 self.Size_Of_Heap_Reserve = Size_Of_Heap_Reserve
12634 self.Size_Of_Heap_Commit = Size_Of_Heap_Commit
12635 self.Loader_Flags = Loader_Flags
12636 self.Number_Of_Rva_And_Sizes = Number_Of_Rva_And_Sizes
12637 self.Data_Directory = Data_Directory
12643 factory = staticmethod(factory)
12707 showIndent(outfile, level)
12708 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
12709 already_processed = []
12710 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Optional_HeaderType')
12711 if self.hasContent_():
12712 outfile.write('>\n')
12713 self.exportChildren(outfile, level + 1, namespace_, name_)
12714 showIndent(outfile, level)
12715 outfile.write('</%s%s>\n' % (namespace_, name_))
12716 else:
12717 outfile.write('/>\n')
12721 if self.Hashes is not None:
12722 self.Hashes.export(outfile, level, namespace_, name_='Hashes')
12723 if self.Major_Linker_Version is not None:
12724 self.Major_Linker_Version.export(outfile, level, namespace_, name_='Major_Linker_Version')
12725 if self.Minor_Linker_Version is not None:
12726 self.Minor_Linker_Version.export(outfile, level, namespace_, name_='Minor_Linker_Version')
12727 if self.Size_Of_Code is not None:
12728 self.Size_Of_Code.export(outfile, level, namespace_, name_='Size_Of_Code')
12729 if self.Size_Of_Initialized_Data is not None:
12730 self.Size_Of_Initialized_Data.export(outfile, level, namespace_, name_='Size_Of_Initialized_Data')
12731 if self.Size_Of_Uninitialized_Data is not None:
12732 self.Size_Of_Uninitialized_Data.export(outfile, level, namespace_, name_='Size_Of_Uninitialized_Data')
12733 if self.Address_Of_Entry_Point is not None:
12734 self.Address_Of_Entry_Point.export(outfile, level, namespace_, name_='Address_Of_Entry_Point')
12735 if self.Base_Of_Code is not None:
12736 self.Base_Of_Code.export(outfile, level, namespace_, name_='Base_Of_Code')
12737 if self.Base_Of_Data is not None:
12738 self.Base_Of_Data.export(outfile, level, namespace_, name_='Base_Of_Data')
12739 if self.Image_Base is not None:
12740 self.Image_Base.export(outfile, level, namespace_, name_='Image_Base')
12741 if self.Section_Alignment is not None:
12742 self.Section_Alignment.export(outfile, level, namespace_, name_='Section_Alignment')
12743 if self.File_Alignment is not None:
12744 self.File_Alignment.export(outfile, level, namespace_, name_='File_Alignment')
12745 if self.Major_OS_Version is not None:
12746 self.Major_OS_Version.export(outfile, level, namespace_, name_='Major_OS_Version')
12747 if self.Minor_OS_Version is not None:
12748 self.Minor_OS_Version.export(outfile, level, namespace_, name_='Minor_OS_Version')
12749 if self.Major_Image_Version is not None:
12750 self.Major_Image_Version.export(outfile, level, namespace_, name_='Major_Image_Version')
12751 if self.Minor_Image_Version is not None:
12752 self.Minor_Image_Version.export(outfile, level, namespace_, name_='Minor_Image_Version')
12753 if self.Major_Subsystem_Version is not None:
12754 self.Major_Subsystem_Version.export(outfile, level, namespace_, name_='Major_Subsystem_Version')
12755 if self.Minor_Subsystem_Version is not None:
12756 self.Minor_Subsystem_Version.export(outfile, level, namespace_, name_='Minor_Subsystem_Version')
12757 if self.Reserved is not None:
12758 self.Reserved.export(outfile, level, namespace_, name_='Reserved')
12759 if self.Size_Of_Image is not None:
12760 self.Size_Of_Image.export(outfile, level, namespace_, name_='Size_Of_Image')
12761 if self.Size_Of_Headers is not None:
12762 self.Size_Of_Headers.export(outfile, level, namespace_, name_='Size_Of_Headers')
12763 if self.Checksum is not None:
12764 self.Checksum.export(outfile, level, namespace_, name_='Checksum')
12765 if self.Subsystem is not None:
12766 self.Subsystem.export(outfile, level, namespace_, name_='Subsystem')
12767 if self.DLL_Characteristics is not None:
12768 self.DLL_Characteristics.export(outfile, level, namespace_, name_='DLL_Characteristics')
12769 if self.Size_Of_Stack_Reserve is not None:
12770 self.Size_Of_Stack_Reserve.export(outfile, level, namespace_, name_='Size_Of_Stack_Reserve')
12771 if self.Size_Of_Stack_Commit is not None:
12772 self.Size_Of_Stack_Commit.export(outfile, level, namespace_, name_='Size_Of_Stack_Commit')
12773 if self.Size_Of_Heap_Reserve is not None:
12774 self.Size_Of_Heap_Reserve.export(outfile, level, namespace_, name_='Size_Of_Heap_Reserve')
12775 if self.Size_Of_Heap_Commit is not None:
12776 self.Size_Of_Heap_Commit.export(outfile, level, namespace_, name_='Size_Of_Heap_Commit')
12777 if self.Loader_Flags is not None:
12778 self.Loader_Flags.export(outfile, level, namespace_, name_='Loader_Flags')
12779 if self.Number_Of_Rva_And_Sizes is not None:
12780 self.Number_Of_Rva_And_Sizes.export(outfile, level, namespace_, name_='Number_Of_Rva_And_Sizes')
12781 if self.Data_Directory is not None:
12782 self.Data_Directory.export(outfile, level, namespace_, name_='Data_Directory')
12784 if (
12785 self.Hashes is not None or
12786 self.Major_Linker_Version is not None or
12787 self.Minor_Linker_Version is not None or
12788 self.Size_Of_Code is not None or
12789 self.Size_Of_Initialized_Data is not None or
12790 self.Size_Of_Uninitialized_Data is not None or
12791 self.Address_Of_Entry_Point is not None or
12792 self.Base_Of_Code is not None or
12793 self.Base_Of_Data is not None or
12794 self.Image_Base is not None or
12795 self.Section_Alignment is not None or
12796 self.File_Alignment is not None or
12797 self.Major_OS_Version is not None or
12798 self.Minor_OS_Version is not None or
12799 self.Major_Image_Version is not None or
12800 self.Minor_Image_Version is not None or
12801 self.Major_Subsystem_Version is not None or
12802 self.Minor_Subsystem_Version is not None or
12803 self.Reserved is not None or
12804 self.Size_Of_Image is not None or
12805 self.Size_Of_Headers is not None or
12806 self.Checksum is not None or
12807 self.Subsystem is not None or
12808 self.DLL_Characteristics is not None or
12809 self.Size_Of_Stack_Reserve is not None or
12810 self.Size_Of_Stack_Commit is not None or
12811 self.Size_Of_Heap_Reserve is not None or
12812 self.Size_Of_Heap_Commit is not None or
12813 self.Loader_Flags is not None or
12814 self.Number_Of_Rva_And_Sizes is not None or
12815 self.Data_Directory is not None
12816 ):
12817 return True
12818 else:
12819 return False
12828 if self.Hashes is not None:
12829 showIndent(outfile, level)
12830 outfile.write('Hashes=model_.HashesType4(\n')
12831 self.Hashes.exportLiteral(outfile, level, name_='Hashes')
12832 showIndent(outfile, level)
12833 outfile.write('),\n')
12834 if self.Major_Linker_Version is not None:
12835 showIndent(outfile, level)
12836 outfile.write('Major_Linker_Version=model_.xs_hexBinary(\n')
12837 self.Major_Linker_Version.exportLiteral(outfile, level, name_='Major_Linker_Version')
12838 showIndent(outfile, level)
12839 outfile.write('),\n')
12840 if self.Minor_Linker_Version is not None:
12841 showIndent(outfile, level)
12842 outfile.write('Minor_Linker_Version=model_.xs_hexBinary(\n')
12843 self.Minor_Linker_Version.exportLiteral(outfile, level, name_='Minor_Linker_Version')
12844 showIndent(outfile, level)
12845 outfile.write('),\n')
12846 if self.Size_Of_Code is not None:
12847 showIndent(outfile, level)
12848 outfile.write('Size_Of_Code=model_.xs_hexBinary(\n')
12849 self.Size_Of_Code.exportLiteral(outfile, level, name_='Size_Of_Code')
12850 showIndent(outfile, level)
12851 outfile.write('),\n')
12852 if self.Size_Of_Initialized_Data is not None:
12853 showIndent(outfile, level)
12854 outfile.write('Size_Of_Initialized_Data=model_.xs_hexBinary(\n')
12855 self.Size_Of_Initialized_Data.exportLiteral(outfile, level, name_='Size_Of_Initialized_Data')
12856 showIndent(outfile, level)
12857 outfile.write('),\n')
12858 if self.Size_Of_Uninitialized_Data is not None:
12859 showIndent(outfile, level)
12860 outfile.write('Size_Of_Uninitialized_Data=model_.xs_hexBinary(\n')
12861 self.Size_Of_Uninitialized_Data.exportLiteral(outfile, level, name_='Size_Of_Uninitialized_Data')
12862 showIndent(outfile, level)
12863 outfile.write('),\n')
12864 if self.Address_Of_Entry_Point is not None:
12865 showIndent(outfile, level)
12866 outfile.write('Address_Of_Entry_Point=model_.xs_hexBinary(\n')
12867 self.Address_Of_Entry_Point.exportLiteral(outfile, level, name_='Address_Of_Entry_Point')
12868 showIndent(outfile, level)
12869 outfile.write('),\n')
12870 if self.Base_Of_Code is not None:
12871 showIndent(outfile, level)
12872 outfile.write('Base_Of_Code=model_.xs_hexBinary(\n')
12873 self.Base_Of_Code.exportLiteral(outfile, level, name_='Base_Of_Code')
12874 showIndent(outfile, level)
12875 outfile.write('),\n')
12876 if self.Base_Of_Data is not None:
12877 showIndent(outfile, level)
12878 outfile.write('Base_Of_Data=model_.xs_hexBinary(\n')
12879 self.Base_Of_Data.exportLiteral(outfile, level, name_='Base_Of_Data')
12880 showIndent(outfile, level)
12881 outfile.write('),\n')
12882 if self.Image_Base is not None:
12883 showIndent(outfile, level)
12884 outfile.write('Image_Base=model_.xs_hexBinary(\n')
12885 self.Image_Base.exportLiteral(outfile, level, name_='Image_Base')
12886 showIndent(outfile, level)
12887 outfile.write('),\n')
12888 if self.Section_Alignment is not None:
12889 showIndent(outfile, level)
12890 outfile.write('Section_Alignment=model_.xs_hexBinary(\n')
12891 self.Section_Alignment.exportLiteral(outfile, level, name_='Section_Alignment')
12892 showIndent(outfile, level)
12893 outfile.write('),\n')
12894 if self.File_Alignment is not None:
12895 showIndent(outfile, level)
12896 outfile.write('File_Alignment=model_.xs_hexBinary(\n')
12897 self.File_Alignment.exportLiteral(outfile, level, name_='File_Alignment')
12898 showIndent(outfile, level)
12899 outfile.write('),\n')
12900 if self.Major_OS_Version is not None:
12901 showIndent(outfile, level)
12902 outfile.write('Major_OS_Version=model_.xs_hexBinary(\n')
12903 self.Major_OS_Version.exportLiteral(outfile, level, name_='Major_OS_Version')
12904 showIndent(outfile, level)
12905 outfile.write('),\n')
12906 if self.Minor_OS_Version is not None:
12907 showIndent(outfile, level)
12908 outfile.write('Minor_OS_Version=model_.xs_hexBinary(\n')
12909 self.Minor_OS_Version.exportLiteral(outfile, level, name_='Minor_OS_Version')
12910 showIndent(outfile, level)
12911 outfile.write('),\n')
12912 if self.Major_Image_Version is not None:
12913 showIndent(outfile, level)
12914 outfile.write('Major_Image_Version=model_.xs_hexBinary(\n')
12915 self.Major_Image_Version.exportLiteral(outfile, level, name_='Major_Image_Version')
12916 showIndent(outfile, level)
12917 outfile.write('),\n')
12918 if self.Minor_Image_Version is not None:
12919 showIndent(outfile, level)
12920 outfile.write('Minor_Image_Version=model_.xs_hexBinary(\n')
12921 self.Minor_Image_Version.exportLiteral(outfile, level, name_='Minor_Image_Version')
12922 showIndent(outfile, level)
12923 outfile.write('),\n')
12924 if self.Major_Subsystem_Version is not None:
12925 showIndent(outfile, level)
12926 outfile.write('Major_Subsystem_Version=model_.xs_hexBinary(\n')
12927 self.Major_Subsystem_Version.exportLiteral(outfile, level, name_='Major_Subsystem_Version')
12928 showIndent(outfile, level)
12929 outfile.write('),\n')
12930 if self.Minor_Subsystem_Version is not None:
12931 showIndent(outfile, level)
12932 outfile.write('Minor_Subsystem_Version=model_.xs_hexBinary(\n')
12933 self.Minor_Subsystem_Version.exportLiteral(outfile, level, name_='Minor_Subsystem_Version')
12934 showIndent(outfile, level)
12935 outfile.write('),\n')
12936 if self.Reserved is not None:
12937 showIndent(outfile, level)
12938 outfile.write('Reserved=model_.xs_hexBinary(\n')
12939 self.Reserved.exportLiteral(outfile, level, name_='Reserved')
12940 showIndent(outfile, level)
12941 outfile.write('),\n')
12942 if self.Size_Of_Image is not None:
12943 showIndent(outfile, level)
12944 outfile.write('Size_Of_Image=model_.xs_hexBinary(\n')
12945 self.Size_Of_Image.exportLiteral(outfile, level, name_='Size_Of_Image')
12946 showIndent(outfile, level)
12947 outfile.write('),\n')
12948 if self.Size_Of_Headers is not None:
12949 showIndent(outfile, level)
12950 outfile.write('Size_Of_Headers=model_.xs_hexBinary(\n')
12951 self.Size_Of_Headers.exportLiteral(outfile, level, name_='Size_Of_Headers')
12952 showIndent(outfile, level)
12953 outfile.write('),\n')
12954 if self.Checksum is not None:
12955 showIndent(outfile, level)
12956 outfile.write('Checksum=model_.xs_hexBinary(\n')
12957 self.Checksum.exportLiteral(outfile, level, name_='Checksum')
12958 showIndent(outfile, level)
12959 outfile.write('),\n')
12960 if self.Subsystem is not None:
12961 showIndent(outfile, level)
12962 outfile.write('Subsystem=model_.xs_hexBinary(\n')
12963 self.Subsystem.exportLiteral(outfile, level, name_='Subsystem')
12964 showIndent(outfile, level)
12965 outfile.write('),\n')
12966 if self.DLL_Characteristics is not None:
12967 showIndent(outfile, level)
12968 outfile.write('DLL_Characteristics=model_.xs_hexBinary(\n')
12969 self.DLL_Characteristics.exportLiteral(outfile, level, name_='DLL_Characteristics')
12970 showIndent(outfile, level)
12971 outfile.write('),\n')
12972 if self.Size_Of_Stack_Reserve is not None:
12973 showIndent(outfile, level)
12974 outfile.write('Size_Of_Stack_Reserve=model_.xs_hexBinary(\n')
12975 self.Size_Of_Stack_Reserve.exportLiteral(outfile, level, name_='Size_Of_Stack_Reserve')
12976 showIndent(outfile, level)
12977 outfile.write('),\n')
12978 if self.Size_Of_Stack_Commit is not None:
12979 showIndent(outfile, level)
12980 outfile.write('Size_Of_Stack_Commit=model_.xs_hexBinary(\n')
12981 self.Size_Of_Stack_Commit.exportLiteral(outfile, level, name_='Size_Of_Stack_Commit')
12982 showIndent(outfile, level)
12983 outfile.write('),\n')
12984 if self.Size_Of_Heap_Reserve is not None:
12985 showIndent(outfile, level)
12986 outfile.write('Size_Of_Heap_Reserve=model_.xs_hexBinary(\n')
12987 self.Size_Of_Heap_Reserve.exportLiteral(outfile, level, name_='Size_Of_Heap_Reserve')
12988 showIndent(outfile, level)
12989 outfile.write('),\n')
12990 if self.Size_Of_Heap_Commit is not None:
12991 showIndent(outfile, level)
12992 outfile.write('Size_Of_Heap_Commit=model_.xs_hexBinary(\n')
12993 self.Size_Of_Heap_Commit.exportLiteral(outfile, level, name_='Size_Of_Heap_Commit')
12994 showIndent(outfile, level)
12995 outfile.write('),\n')
12996 if self.Loader_Flags is not None:
12997 showIndent(outfile, level)
12998 outfile.write('Loader_Flags=model_.xs_hexBinary(\n')
12999 self.Loader_Flags.exportLiteral(outfile, level, name_='Loader_Flags')
13000 showIndent(outfile, level)
13001 outfile.write('),\n')
13002 if self.Number_Of_Rva_And_Sizes is not None:
13003 showIndent(outfile, level)
13004 outfile.write('Number_Of_Rva_And_Sizes=model_.xs_hexBinary(\n')
13005 self.Number_Of_Rva_And_Sizes.exportLiteral(outfile, level, name_='Number_Of_Rva_And_Sizes')
13006 showIndent(outfile, level)
13007 outfile.write('),\n')
13008 if self.Data_Directory is not None:
13009 showIndent(outfile, level)
13010 outfile.write('Data_Directory=model_.Data_DirectoryType(\n')
13011 self.Data_Directory.exportLiteral(outfile, level, name_='Data_Directory')
13012 showIndent(outfile, level)
13013 outfile.write('),\n')
13146
13147
13148
13150 subclass = None
13151 superclass = None
13153 if Hash is None:
13154 self.Hash = []
13155 else:
13156 self.Hash = Hash
13162 factory = staticmethod(factory)
13164 - def set_Hash(self, Hash): self.Hash = Hash
13165 - def add_Hash(self, value): self.Hash.append(value)
13166 - def insert_Hash(self, index, value): self.Hash[index] = value
13167 - def export(self, outfile, level, namespace_='maec:', name_='HashesType4', namespacedef_=''):
13168 showIndent(outfile, level)
13169 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
13170 already_processed = []
13171 self.exportAttributes(outfile, level, already_processed, namespace_, name_='HashesType4')
13172 if self.hasContent_():
13173 outfile.write('>\n')
13174 self.exportChildren(outfile, level + 1, namespace_, name_)
13175 showIndent(outfile, level)
13176 outfile.write('</%s%s>\n' % (namespace_, name_))
13177 else:
13178 outfile.write('/>\n')
13179 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='HashesType4'):
13181 - def exportChildren(self, outfile, level, namespace_='maec:', name_='HashesType4', fromsubclass_=False):
13182 for Hash_ in self.Hash:
13183 Hash_.export(outfile, level, namespace_, name_='Hash')
13184 - def hasContent_(self):
13185 if (
13186 self.Hash
13187 ):
13188 return True
13189 else:
13190 return False
13199 showIndent(outfile, level)
13200 outfile.write('Hash=[\n')
13201 level += 1
13202 for Hash_ in self.Hash:
13203 showIndent(outfile, level)
13204 outfile.write('model_.HashType(\n')
13205 Hash_.exportLiteral(outfile, level, name_='HashType')
13206 showIndent(outfile, level)
13207 outfile.write('),\n')
13208 level -= 1
13209 showIndent(outfile, level)
13210 outfile.write('],\n')
13211 - def build(self, node):
13218 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
13219 if nodeName_ == 'Hash':
13220 obj_ = HashType.factory()
13221 obj_.build(child_)
13222 self.Hash.append(obj_)
13223
13224
13225
13227 subclass = None
13228 superclass = None
13229 - def __init__(self, Export_Symbols=None, Import_Symbols=None, Resources=None, Exception=None, Security=None, Base_Relocation=None, Debug=None, Architecture=None, Copyright_String=None, Unknown=None, Thread_Local_Storage=None, Load_Configuration=None, Bound_Import=None, Import_Address_Table=None, Delay_Import=None, COM_Descriptor=None):
13230 self.Export_Symbols = Export_Symbols
13231 self.Import_Symbols = Import_Symbols
13232 self.Resources = Resources
13233 self.Exception = Exception
13234 self.Security = Security
13235 self.Base_Relocation = Base_Relocation
13236 self.Debug = Debug
13237 self.Architecture = Architecture
13238 self.Copyright_String = Copyright_String
13239 self.Unknown = Unknown
13240 self.Thread_Local_Storage = Thread_Local_Storage
13241 self.Load_Configuration = Load_Configuration
13242 self.Bound_Import = Bound_Import
13243 self.Import_Address_Table = Import_Address_Table
13244 self.Delay_Import = Delay_Import
13245 self.COM_Descriptor = COM_Descriptor
13251 factory = staticmethod(factory)
13257 - def set_Resources(self, Resources): self.Resources = Resources
13259 - def set_Exception(self, Exception): self.Exception = Exception
13261 - def set_Security(self, Security): self.Security = Security
13271 - def set_Unknown(self, Unknown): self.Unknown = Unknown
13284 - def export(self, outfile, level, namespace_='maec:', name_='Data_DirectoryType', namespacedef_=''):
13285 showIndent(outfile, level)
13286 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
13287 already_processed = []
13288 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Data_DirectoryType')
13289 if self.hasContent_():
13290 outfile.write('>\n')
13291 self.exportChildren(outfile, level + 1, namespace_, name_)
13292 showIndent(outfile, level)
13293 outfile.write('</%s%s>\n' % (namespace_, name_))
13294 else:
13295 outfile.write('/>\n')
13296 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Data_DirectoryType'):
13298 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Data_DirectoryType', fromsubclass_=False):
13299 if self.Export_Symbols is not None:
13300 self.Export_Symbols.export(outfile, level, namespace_, name_='Export_Symbols')
13301 if self.Import_Symbols is not None:
13302 self.Import_Symbols.export(outfile, level, namespace_, name_='Import_Symbols')
13303 if self.Resources is not None:
13304 self.Resources.export(outfile, level, namespace_, name_='Resources')
13305 if self.Exception is not None:
13306 self.Exception.export(outfile, level, namespace_, name_='Exception')
13307 if self.Security is not None:
13308 self.Security.export(outfile, level, namespace_, name_='Security')
13309 if self.Base_Relocation is not None:
13310 self.Base_Relocation.export(outfile, level, namespace_, name_='Base_Relocation')
13311 if self.Debug is not None:
13312 self.Debug.export(outfile, level, namespace_, name_='Debug')
13313 if self.Architecture is not None:
13314 self.Architecture.export(outfile, level, namespace_, name_='Architecture')
13315 if self.Copyright_String is not None:
13316 self.Copyright_String.export(outfile, level, namespace_, name_='Copyright_String')
13317 if self.Unknown is not None:
13318 self.Unknown.export(outfile, level, namespace_, name_='Unknown')
13319 if self.Thread_Local_Storage is not None:
13320 self.Thread_Local_Storage.export(outfile, level, namespace_, name_='Thread_Local_Storage')
13321 if self.Load_Configuration is not None:
13322 self.Load_Configuration.export(outfile, level, namespace_, name_='Load_Configuration')
13323 if self.Bound_Import is not None:
13324 self.Bound_Import.export(outfile, level, namespace_, name_='Bound_Import')
13325 if self.Import_Address_Table is not None:
13326 self.Import_Address_Table.export(outfile, level, namespace_, name_='Import_Address_Table')
13327 if self.Delay_Import is not None:
13328 self.Delay_Import.export(outfile, level, namespace_, name_='Delay_Import')
13329 if self.COM_Descriptor is not None:
13330 self.COM_Descriptor.export(outfile, level, namespace_, name_='COM_Descriptor')
13331 - def hasContent_(self):
13332 if (
13333 self.Export_Symbols is not None or
13334 self.Import_Symbols is not None or
13335 self.Resources is not None or
13336 self.Exception is not None or
13337 self.Security is not None or
13338 self.Base_Relocation is not None or
13339 self.Debug is not None or
13340 self.Architecture is not None or
13341 self.Copyright_String is not None or
13342 self.Unknown is not None or
13343 self.Thread_Local_Storage is not None or
13344 self.Load_Configuration is not None or
13345 self.Bound_Import is not None or
13346 self.Import_Address_Table is not None or
13347 self.Delay_Import is not None or
13348 self.COM_Descriptor is not None
13349 ):
13350 return True
13351 else:
13352 return False
13353 - def exportLiteral(self, outfile, level, name_='Data_DirectoryType'):
13361 if self.Export_Symbols is not None:
13362 showIndent(outfile, level)
13363 outfile.write('Export_Symbols=model_.PEDataDirectoryStruct(\n')
13364 self.Export_Symbols.exportLiteral(outfile, level, name_='Export_Symbols')
13365 showIndent(outfile, level)
13366 outfile.write('),\n')
13367 if self.Import_Symbols is not None:
13368 showIndent(outfile, level)
13369 outfile.write('Import_Symbols=model_.PEDataDirectoryStruct(\n')
13370 self.Import_Symbols.exportLiteral(outfile, level, name_='Import_Symbols')
13371 showIndent(outfile, level)
13372 outfile.write('),\n')
13373 if self.Resources is not None:
13374 showIndent(outfile, level)
13375 outfile.write('Resources=model_.PEDataDirectoryStruct(\n')
13376 self.Resources.exportLiteral(outfile, level, name_='Resources')
13377 showIndent(outfile, level)
13378 outfile.write('),\n')
13379 if self.Exception is not None:
13380 showIndent(outfile, level)
13381 outfile.write('Exception=model_.PEDataDirectoryStruct(\n')
13382 self.Exception.exportLiteral(outfile, level, name_='Exception')
13383 showIndent(outfile, level)
13384 outfile.write('),\n')
13385 if self.Security is not None:
13386 showIndent(outfile, level)
13387 outfile.write('Security=model_.PEDataDirectoryStruct(\n')
13388 self.Security.exportLiteral(outfile, level, name_='Security')
13389 showIndent(outfile, level)
13390 outfile.write('),\n')
13391 if self.Base_Relocation is not None:
13392 showIndent(outfile, level)
13393 outfile.write('Base_Relocation=model_.PEDataDirectoryStruct(\n')
13394 self.Base_Relocation.exportLiteral(outfile, level, name_='Base_Relocation')
13395 showIndent(outfile, level)
13396 outfile.write('),\n')
13397 if self.Debug is not None:
13398 showIndent(outfile, level)
13399 outfile.write('Debug=model_.PEDataDirectoryStruct(\n')
13400 self.Debug.exportLiteral(outfile, level, name_='Debug')
13401 showIndent(outfile, level)
13402 outfile.write('),\n')
13403 if self.Architecture is not None:
13404 showIndent(outfile, level)
13405 outfile.write('Architecture=model_.PEDataDirectoryStruct(\n')
13406 self.Architecture.exportLiteral(outfile, level, name_='Architecture')
13407 showIndent(outfile, level)
13408 outfile.write('),\n')
13409 if self.Copyright_String is not None:
13410 showIndent(outfile, level)
13411 outfile.write('Copyright_String=model_.PEDataDirectoryStruct(\n')
13412 self.Copyright_String.exportLiteral(outfile, level, name_='Copyright_String')
13413 showIndent(outfile, level)
13414 outfile.write('),\n')
13415 if self.Unknown is not None:
13416 showIndent(outfile, level)
13417 outfile.write('Unknown=model_.PEDataDirectoryStruct(\n')
13418 self.Unknown.exportLiteral(outfile, level, name_='Unknown')
13419 showIndent(outfile, level)
13420 outfile.write('),\n')
13421 if self.Thread_Local_Storage is not None:
13422 showIndent(outfile, level)
13423 outfile.write('Thread_Local_Storage=model_.PEDataDirectoryStruct(\n')
13424 self.Thread_Local_Storage.exportLiteral(outfile, level, name_='Thread_Local_Storage')
13425 showIndent(outfile, level)
13426 outfile.write('),\n')
13427 if self.Load_Configuration is not None:
13428 showIndent(outfile, level)
13429 outfile.write('Load_Configuration=model_.PEDataDirectoryStruct(\n')
13430 self.Load_Configuration.exportLiteral(outfile, level, name_='Load_Configuration')
13431 showIndent(outfile, level)
13432 outfile.write('),\n')
13433 if self.Bound_Import is not None:
13434 showIndent(outfile, level)
13435 outfile.write('Bound_Import=model_.PEDataDirectoryStruct(\n')
13436 self.Bound_Import.exportLiteral(outfile, level, name_='Bound_Import')
13437 showIndent(outfile, level)
13438 outfile.write('),\n')
13439 if self.Import_Address_Table is not None:
13440 showIndent(outfile, level)
13441 outfile.write('Import_Address_Table=model_.PEDataDirectoryStruct(\n')
13442 self.Import_Address_Table.exportLiteral(outfile, level, name_='Import_Address_Table')
13443 showIndent(outfile, level)
13444 outfile.write('),\n')
13445 if self.Delay_Import is not None:
13446 showIndent(outfile, level)
13447 outfile.write('Delay_Import=model_.PEDataDirectoryStruct(\n')
13448 self.Delay_Import.exportLiteral(outfile, level, name_='Delay_Import')
13449 showIndent(outfile, level)
13450 outfile.write('),\n')
13451 if self.COM_Descriptor is not None:
13452 showIndent(outfile, level)
13453 outfile.write('COM_Descriptor=model_.PEDataDirectoryStruct(\n')
13454 self.COM_Descriptor.exportLiteral(outfile, level, name_='COM_Descriptor')
13455 showIndent(outfile, level)
13456 outfile.write('),\n')
13457 - def build(self, node):
13464 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
13529
13530
13531
13533 subclass = None
13534 superclass = None
13535 - def __init__(self, Section_Header=None):
13536 if Section_Header is None:
13537 self.Section_Header = []
13538 else:
13539 self.Section_Header = Section_Header
13545 factory = staticmethod(factory)
13550 - def export(self, outfile, level, namespace_='maec:', name_='Section_TableType', namespacedef_=''):
13551 showIndent(outfile, level)
13552 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
13553 already_processed = []
13554 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Section_TableType')
13555 if self.hasContent_():
13556 outfile.write('>\n')
13557 self.exportChildren(outfile, level + 1, namespace_, name_)
13558 showIndent(outfile, level)
13559 outfile.write('</%s%s>\n' % (namespace_, name_))
13560 else:
13561 outfile.write('/>\n')
13562 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Section_TableType'):
13564 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Section_TableType', fromsubclass_=False):
13565 for Section_Header_ in self.Section_Header:
13566 Section_Header_.export(outfile, level, namespace_, name_='Section_Header')
13567 - def hasContent_(self):
13568 if (
13569 self.Section_Header
13570 ):
13571 return True
13572 else:
13573 return False
13574 - def exportLiteral(self, outfile, level, name_='Section_TableType'):
13582 showIndent(outfile, level)
13583 outfile.write('Section_Header=[\n')
13584 level += 1
13585 for Section_Header_ in self.Section_Header:
13586 showIndent(outfile, level)
13587 outfile.write('model_.PESectionHeaderStruct(\n')
13588 Section_Header_.exportLiteral(outfile, level, name_='PESectionHeaderStruct')
13589 showIndent(outfile, level)
13590 outfile.write('),\n')
13591 level -= 1
13592 showIndent(outfile, level)
13593 outfile.write('],\n')
13594 - def build(self, node):
13601 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
13606
13607
13608
13610 subclass = None
13611 superclass = None
13613 if String is None:
13614 self.String = []
13615 else:
13616 self.String = String
13622 factory = staticmethod(factory)
13624 - def set_String(self, String): self.String = String
13625 - def add_String(self, value): self.String.append(value)
13626 - def insert_String(self, index, value): self.String[index] = value
13627 - def export(self, outfile, level, namespace_='maec:', name_='StringsType', namespacedef_=''):
13628 showIndent(outfile, level)
13629 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
13630 already_processed = []
13631 self.exportAttributes(outfile, level, already_processed, namespace_, name_='StringsType')
13632 if self.hasContent_():
13633 outfile.write('>\n')
13634 self.exportChildren(outfile, level + 1, namespace_, name_)
13635 showIndent(outfile, level)
13636 outfile.write('</%s%s>\n' % (namespace_, name_))
13637 else:
13638 outfile.write('/>\n')
13639 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='StringsType'):
13641 - def exportChildren(self, outfile, level, namespace_='maec:', name_='StringsType', fromsubclass_=False):
13642 for String_ in self.String:
13643 String_.export(outfile, level, namespace_, name_='String')
13644 - def hasContent_(self):
13645 if (
13646 self.String
13647 ):
13648 return True
13649 else:
13650 return False
13659 showIndent(outfile, level)
13660 outfile.write('String=[\n')
13661 level += 1
13662 for String_ in self.String:
13663 showIndent(outfile, level)
13664 outfile.write('model_.PEStringType(\n')
13665 String_.exportLiteral(outfile, level, name_='PEStringType')
13666 showIndent(outfile, level)
13667 outfile.write('),\n')
13668 level -= 1
13669 showIndent(outfile, level)
13670 outfile.write('],\n')
13671 - def build(self, node):
13678 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
13679 if nodeName_ == 'String':
13680 obj_ = PEStringType.factory()
13681 obj_.build(child_)
13682 self.String.append(obj_)
13683
13684
13685
13687 subclass = None
13688 superclass = None
13690 if Import is None:
13691 self.Import = []
13692 else:
13693 self.Import = Import
13699 factory = staticmethod(factory)
13701 - def set_Import(self, Import): self.Import = Import
13702 - def add_Import(self, value): self.Import.append(value)
13703 - def insert_Import(self, index, value): self.Import[index] = value
13704 - def export(self, outfile, level, namespace_='maec:', name_='ImportsType', namespacedef_=''):
13705 showIndent(outfile, level)
13706 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
13707 already_processed = []
13708 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ImportsType')
13709 if self.hasContent_():
13710 outfile.write('>\n')
13711 self.exportChildren(outfile, level + 1, namespace_, name_)
13712 showIndent(outfile, level)
13713 outfile.write('</%s%s>\n' % (namespace_, name_))
13714 else:
13715 outfile.write('/>\n')
13716 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ImportsType'):
13718 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ImportsType', fromsubclass_=False):
13719 for Import_ in self.Import:
13720 Import_.export(outfile, level, namespace_, name_='Import')
13721 - def hasContent_(self):
13722 if (
13723 self.Import
13724 ):
13725 return True
13726 else:
13727 return False
13736 showIndent(outfile, level)
13737 outfile.write('Import=[\n')
13738 level += 1
13739 for Import_ in self.Import:
13740 showIndent(outfile, level)
13741 outfile.write('model_.PEImportType(\n')
13742 Import_.exportLiteral(outfile, level, name_='PEImportType')
13743 showIndent(outfile, level)
13744 outfile.write('),\n')
13745 level -= 1
13746 showIndent(outfile, level)
13747 outfile.write('],\n')
13748 - def build(self, node):
13755 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
13756 if nodeName_ == 'Import':
13757 obj_ = PEImportType.factory()
13758 obj_.build(child_)
13759 self.Import.append(obj_)
13760
13761
13762
13764 subclass = None
13765 superclass = None
13767 if Export is None:
13768 self.Export = []
13769 else:
13770 self.Export = Export
13776 factory = staticmethod(factory)
13778 - def set_Export(self, Export): self.Export = Export
13779 - def add_Export(self, value): self.Export.append(value)
13780 - def insert_Export(self, index, value): self.Export[index] = value
13781 - def export(self, outfile, level, namespace_='maec:', name_='ExportsType', namespacedef_=''):
13782 showIndent(outfile, level)
13783 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
13784 already_processed = []
13785 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ExportsType')
13786 if self.hasContent_():
13787 outfile.write('>\n')
13788 self.exportChildren(outfile, level + 1, namespace_, name_)
13789 showIndent(outfile, level)
13790 outfile.write('</%s%s>\n' % (namespace_, name_))
13791 else:
13792 outfile.write('/>\n')
13793 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ExportsType'):
13795 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ExportsType', fromsubclass_=False):
13796 for Export_ in self.Export:
13797 Export_.export(outfile, level, namespace_, name_='Export')
13798 - def hasContent_(self):
13799 if (
13800 self.Export
13801 ):
13802 return True
13803 else:
13804 return False
13813 showIndent(outfile, level)
13814 outfile.write('Export=[\n')
13815 level += 1
13816 for Export_ in self.Export:
13817 showIndent(outfile, level)
13818 outfile.write('model_.PEExportType(\n')
13819 Export_.exportLiteral(outfile, level, name_='PEExportType')
13820 showIndent(outfile, level)
13821 outfile.write('),\n')
13822 level -= 1
13823 showIndent(outfile, level)
13824 outfile.write('],\n')
13825 - def build(self, node):
13832 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
13833 if nodeName_ == 'Export':
13834 obj_ = PEExportType.factory()
13835 obj_.build(child_)
13836 self.Export.append(obj_)
13837
13838
13839
13841 subclass = None
13842 superclass = None
13844 if Resource is None:
13845 self.Resource = []
13846 else:
13847 self.Resource = Resource
13853 factory = staticmethod(factory)
13855 - def set_Resource(self, Resource): self.Resource = Resource
13856 - def add_Resource(self, value): self.Resource.append(value)
13858 - def export(self, outfile, level, namespace_='maec:', name_='ResourcesType', namespacedef_=''):
13859 showIndent(outfile, level)
13860 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
13861 already_processed = []
13862 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ResourcesType')
13863 if self.hasContent_():
13864 outfile.write('>\n')
13865 self.exportChildren(outfile, level + 1, namespace_, name_)
13866 showIndent(outfile, level)
13867 outfile.write('</%s%s>\n' % (namespace_, name_))
13868 else:
13869 outfile.write('/>\n')
13870 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ResourcesType'):
13872 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ResourcesType', fromsubclass_=False):
13873 for Resource_ in self.Resource:
13874 Resource_.export(outfile, level, namespace_, name_='Resource')
13875 - def hasContent_(self):
13876 if (
13877 self.Resource
13878 ):
13879 return True
13880 else:
13881 return False
13882 - def exportLiteral(self, outfile, level, name_='ResourcesType'):
13890 showIndent(outfile, level)
13891 outfile.write('Resource=[\n')
13892 level += 1
13893 for Resource_ in self.Resource:
13894 showIndent(outfile, level)
13895 outfile.write('model_.PEResourceType(\n')
13896 Resource_.exportLiteral(outfile, level, name_='PEResourceType')
13897 showIndent(outfile, level)
13898 outfile.write('),\n')
13899 level -= 1
13900 showIndent(outfile, level)
13901 outfile.write('],\n')
13902 - def build(self, node):
13909 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
13914
13915
13916
13918 subclass = None
13919 superclass = None
13921 if Section is None:
13922 self.Section = []
13923 else:
13924 self.Section = Section
13930 factory = staticmethod(factory)
13932 - def set_Section(self, Section): self.Section = Section
13933 - def add_Section(self, value): self.Section.append(value)
13934 - def insert_Section(self, index, value): self.Section[index] = value
13935 - def export(self, outfile, level, namespace_='maec:', name_='SectionsType', namespacedef_=''):
13936 showIndent(outfile, level)
13937 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
13938 already_processed = []
13939 self.exportAttributes(outfile, level, already_processed, namespace_, name_='SectionsType')
13940 if self.hasContent_():
13941 outfile.write('>\n')
13942 self.exportChildren(outfile, level + 1, namespace_, name_)
13943 showIndent(outfile, level)
13944 outfile.write('</%s%s>\n' % (namespace_, name_))
13945 else:
13946 outfile.write('/>\n')
13947 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='SectionsType'):
13949 - def exportChildren(self, outfile, level, namespace_='maec:', name_='SectionsType', fromsubclass_=False):
13950 for Section_ in self.Section:
13951 Section_.export(outfile, level, namespace_, name_='Section')
13952 - def hasContent_(self):
13953 if (
13954 self.Section
13955 ):
13956 return True
13957 else:
13958 return False
13959 - def exportLiteral(self, outfile, level, name_='SectionsType'):
13967 showIndent(outfile, level)
13968 outfile.write('Section=[\n')
13969 level += 1
13970 for Section_ in self.Section:
13971 showIndent(outfile, level)
13972 outfile.write('model_.PESectionType(\n')
13973 Section_.exportLiteral(outfile, level, name_='PESectionType')
13974 showIndent(outfile, level)
13975 outfile.write('),\n')
13976 level -= 1
13977 showIndent(outfile, level)
13978 outfile.write('],\n')
13979 - def build(self, node):
13986 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
13987 if nodeName_ == 'Section':
13988 obj_ = PESectionType.factory()
13989 obj_.build(child_)
13990 self.Section.append(obj_)
13991
13992
13993
13995 subclass = None
13996 superclass = None
13997 - def __init__(self, Certificate=None):
13998 if Certificate is None:
13999 self.Certificate = []
14000 else:
14001 self.Certificate = Certificate
14007 factory = staticmethod(factory)
14012 - def export(self, outfile, level, namespace_='maec:', name_='Digital_CertificatesType', namespacedef_=''):
14013 showIndent(outfile, level)
14014 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
14015 already_processed = []
14016 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Digital_CertificatesType')
14017 if self.hasContent_():
14018 outfile.write('>\n')
14019 self.exportChildren(outfile, level + 1, namespace_, name_)
14020 showIndent(outfile, level)
14021 outfile.write('</%s%s>\n' % (namespace_, name_))
14022 else:
14023 outfile.write('/>\n')
14024 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Digital_CertificatesType'):
14026 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Digital_CertificatesType', fromsubclass_=False):
14027 for Certificate_ in self.Certificate:
14028 Certificate_.export(outfile, level, namespace_, name_='Certificate')
14029 - def hasContent_(self):
14030 if (
14031 self.Certificate
14032 ):
14033 return True
14034 else:
14035 return False
14036 - def exportLiteral(self, outfile, level, name_='Digital_CertificatesType'):
14044 showIndent(outfile, level)
14045 outfile.write('Certificate=[\n')
14046 level += 1
14047 for Certificate_ in self.Certificate:
14048 showIndent(outfile, level)
14049 outfile.write('model_.CertificateType(\n')
14050 Certificate_.exportLiteral(outfile, level, name_='CertificateType')
14051 showIndent(outfile, level)
14052 outfile.write('),\n')
14053 level -= 1
14054 showIndent(outfile, level)
14055 outfile.write('],\n')
14056 - def build(self, node):
14063 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
14064 if nodeName_ == 'Certificate':
14065 obj_ = CertificateType.factory()
14066 obj_.build(child_)
14067 self.Certificate.append(obj_)
14068
14069
14070
14072 """This boolean attribute represents whether the digital certificate is
14073 valid or not."""
14074 subclass = None
14075 superclass = None
14076 - def __init__(self, validity=None, Issuer=None):
14077 self.validity = _cast(bool, validity)
14078 self.Issuer = Issuer
14084 factory = staticmethod(factory)
14086 - def set_Issuer(self, Issuer): self.Issuer = Issuer
14088 - def set_validity(self, validity): self.validity = validity
14089 - def export(self, outfile, level, namespace_='maec:', name_='CertificateType', namespacedef_=''):
14090 showIndent(outfile, level)
14091 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
14092 already_processed = []
14093 self.exportAttributes(outfile, level, already_processed, namespace_, name_='CertificateType')
14094 if self.hasContent_():
14095 outfile.write('>\n')
14096 self.exportChildren(outfile, level + 1, namespace_, name_)
14097 showIndent(outfile, level)
14098 outfile.write('</%s%s>\n' % (namespace_, name_))
14099 else:
14100 outfile.write('/>\n')
14101 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='CertificateType'):
14102 if self.validity is not None and 'validity' not in already_processed:
14103 already_processed.append('validity')
14104 outfile.write(' validity="%s"' % self.gds_format_boolean(self.gds_str_lower(str(self.validity)), input_name='validity'))
14105 - def exportChildren(self, outfile, level, namespace_='maec:', name_='CertificateType', fromsubclass_=False):
14109 - def hasContent_(self):
14110 if (
14111 self.Issuer is not None
14112 ):
14113 return True
14114 else:
14115 return False
14116 - def exportLiteral(self, outfile, level, name_='CertificateType'):
14122 if self.validity is not None and 'validity' not in already_processed:
14123 already_processed.append('validity')
14124 showIndent(outfile, level)
14125 outfile.write('validity = %s,\n' % (self.validity,))
14130 - def build(self, node):
14136 value = find_attr_value_('validity', node)
14137 if value is not None and 'validity' not in already_processed:
14138 already_processed.append('validity')
14139 if value in ('true', '1'):
14140 self.validity = True
14141 elif value in ('false', '0'):
14142 self.validity = False
14143 else:
14144 raise_parse_error(node, 'Bad boolean attribute')
14145 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
14146 if nodeName_ == 'Issuer':
14147 Issuer_ = child_.text
14148 Issuer_ = self.gds_validate_string(Issuer_, node, 'Issuer')
14149 self.Issuer = Issuer_
14150
14151
14152
14154 subclass = None
14155 superclass = None
14156 - def __init__(self, Width=None, Height=None, Window_Display_Name=None, Parent_Window=None, Owner_Window=None, Box_Text=None, Box_Caption=None):
14157 self.Width = Width
14158 self.Height = Height
14159 self.Window_Display_Name = Window_Display_Name
14160 self.Parent_Window = Parent_Window
14161 self.Owner_Window = Owner_Window
14162 self.Box_Text = Box_Text
14163 self.Box_Caption = Box_Caption
14169 factory = staticmethod(factory)
14171 - def set_Width(self, Width): self.Width = Width
14173 - def set_Height(self, Height): self.Height = Height
14180 - def get_Box_Text(self): return self.Box_Text
14181 - def set_Box_Text(self, Box_Text): self.Box_Text = Box_Text
14184 - def export(self, outfile, level, namespace_='maec:', name_='GUI_Object_AttributesType', namespacedef_=''):
14185 showIndent(outfile, level)
14186 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
14187 already_processed = []
14188 self.exportAttributes(outfile, level, already_processed, namespace_, name_='GUI_Object_AttributesType')
14189 if self.hasContent_():
14190 outfile.write('>\n')
14191 self.exportChildren(outfile, level + 1, namespace_, name_)
14192 showIndent(outfile, level)
14193 outfile.write('</%s%s>\n' % (namespace_, name_))
14194 else:
14195 outfile.write('/>\n')
14196 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='GUI_Object_AttributesType'):
14198 - def exportChildren(self, outfile, level, namespace_='maec:', name_='GUI_Object_AttributesType', fromsubclass_=False):
14199 if self.Width is not None:
14200 showIndent(outfile, level)
14201 outfile.write('<%sWidth>%s</%sWidth>\n' % (namespace_, self.gds_format_integer(self.Width, input_name='Width'), namespace_))
14202 if self.Height is not None:
14203 showIndent(outfile, level)
14204 outfile.write('<%sHeight>%s</%sHeight>\n' % (namespace_, self.gds_format_integer(self.Height, input_name='Height'), namespace_))
14205 if self.Window_Display_Name is not None:
14206 showIndent(outfile, level)
14207 outfile.write('<%sWindow_Display_Name>%s</%sWindow_Display_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.Window_Display_Name).encode(ExternalEncoding), input_name='Window_Display_Name'), namespace_))
14208 if self.Parent_Window is not None:
14209 showIndent(outfile, level)
14210 outfile.write('<%sParent_Window>%s</%sParent_Window>\n' % (namespace_, self.gds_format_string(quote_xml(self.Parent_Window).encode(ExternalEncoding), input_name='Parent_Window'), namespace_))
14211 if self.Owner_Window is not None:
14212 showIndent(outfile, level)
14213 outfile.write('<%sOwner_Window>%s</%sOwner_Window>\n' % (namespace_, self.gds_format_string(quote_xml(self.Owner_Window).encode(ExternalEncoding), input_name='Owner_Window'), namespace_))
14214 if self.Box_Text is not None:
14215 showIndent(outfile, level)
14216 outfile.write('<%sBox_Text>%s</%sBox_Text>\n' % (namespace_, self.gds_format_string(quote_xml(self.Box_Text).encode(ExternalEncoding), input_name='Box_Text'), namespace_))
14217 if self.Box_Caption is not None:
14218 showIndent(outfile, level)
14219 outfile.write('<%sBox_Caption>%s</%sBox_Caption>\n' % (namespace_, self.gds_format_string(quote_xml(self.Box_Caption).encode(ExternalEncoding), input_name='Box_Caption'), namespace_))
14220 - def hasContent_(self):
14221 if (
14222 self.Width is not None or
14223 self.Height is not None or
14224 self.Window_Display_Name is not None or
14225 self.Parent_Window is not None or
14226 self.Owner_Window is not None or
14227 self.Box_Text is not None or
14228 self.Box_Caption is not None
14229 ):
14230 return True
14231 else:
14232 return False
14233 - def exportLiteral(self, outfile, level, name_='GUI_Object_AttributesType'):
14241 if self.Width is not None:
14242 showIndent(outfile, level)
14243 outfile.write('Width=%d,\n' % self.Width)
14244 if self.Height is not None:
14245 showIndent(outfile, level)
14246 outfile.write('Height=%d,\n' % self.Height)
14247 if self.Window_Display_Name is not None:
14248 showIndent(outfile, level)
14249 outfile.write('Window_Display_Name=%s,\n' % quote_python(self.Window_Display_Name).encode(ExternalEncoding))
14250 if self.Parent_Window is not None:
14251 showIndent(outfile, level)
14252 outfile.write('Parent_Window=%s,\n' % quote_python(self.Parent_Window).encode(ExternalEncoding))
14253 if self.Owner_Window is not None:
14254 showIndent(outfile, level)
14255 outfile.write('Owner_Window=%s,\n' % quote_python(self.Owner_Window).encode(ExternalEncoding))
14256 if self.Box_Text is not None:
14257 showIndent(outfile, level)
14258 outfile.write('Box_Text=%s,\n' % quote_python(self.Box_Text).encode(ExternalEncoding))
14259 if self.Box_Caption is not None:
14260 showIndent(outfile, level)
14261 outfile.write('Box_Caption=%s,\n' % quote_python(self.Box_Caption).encode(ExternalEncoding))
14262 - def build(self, node):
14269 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
14270 if nodeName_ == 'Width':
14271 sval_ = child_.text
14272 try:
14273 ival_ = int(sval_)
14274 except (TypeError, ValueError) as e:
14275 raise_parse_error(child_, 'requires integer: %s' % e)
14276 ival_ = self.gds_validate_integer(ival_, node, 'Width')
14277 self.Width = ival_
14278 elif nodeName_ == 'Height':
14279 sval_ = child_.text
14280 try:
14281 ival_ = int(sval_)
14282 except (TypeError, ValueError) as e:
14283 raise_parse_error(child_, 'requires integer: %s' % e)
14284 ival_ = self.gds_validate_integer(ival_, node, 'Height')
14285 self.Height = ival_
14286 elif nodeName_ == 'Window_Display_Name':
14287 Window_Display_Name_ = child_.text
14288 Window_Display_Name_ = self.gds_validate_string(Window_Display_Name_, node, 'Window_Display_Name')
14289 self.Window_Display_Name = Window_Display_Name_
14290 elif nodeName_ == 'Parent_Window':
14291 Parent_Window_ = child_.text
14292 Parent_Window_ = self.gds_validate_string(Parent_Window_, node, 'Parent_Window')
14293 self.Parent_Window = Parent_Window_
14294 elif nodeName_ == 'Owner_Window':
14295 Owner_Window_ = child_.text
14296 Owner_Window_ = self.gds_validate_string(Owner_Window_, node, 'Owner_Window')
14297 self.Owner_Window = Owner_Window_
14298 elif nodeName_ == 'Box_Text':
14299 Box_Text_ = child_.text
14300 Box_Text_ = self.gds_validate_string(Box_Text_, node, 'Box_Text')
14301 self.Box_Text = Box_Text_
14302 elif nodeName_ == 'Box_Caption':
14303 Box_Caption_ = child_.text
14304 Box_Caption_ = self.gds_validate_string(Box_Caption_, node, 'Box_Caption')
14305 self.Box_Caption = Box_Caption_
14306
14307
14308
14310 subclass = None
14311 superclass = None
14312 - def __init__(self, Security_Attributes=None, Event_Type=None, Thread_ID=None, Start_Address=None):
14313 self.Security_Attributes = Security_Attributes
14314 self.Event_Type = Event_Type
14315 self.Thread_ID = Thread_ID
14316 self.Start_Address = Start_Address
14322 factory = staticmethod(factory)
14328 - def set_Thread_ID(self, Thread_ID): self.Thread_ID = Thread_ID
14331 - def export(self, outfile, level, namespace_='maec:', name_='IPC_Object_AttributesType', namespacedef_=''):
14332 showIndent(outfile, level)
14333 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
14334 already_processed = []
14335 self.exportAttributes(outfile, level, already_processed, namespace_, name_='IPC_Object_AttributesType')
14336 if self.hasContent_():
14337 outfile.write('>\n')
14338 self.exportChildren(outfile, level + 1, namespace_, name_)
14339 showIndent(outfile, level)
14340 outfile.write('</%s%s>\n' % (namespace_, name_))
14341 else:
14342 outfile.write('/>\n')
14343 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='IPC_Object_AttributesType'):
14345 - def exportChildren(self, outfile, level, namespace_='maec:', name_='IPC_Object_AttributesType', fromsubclass_=False):
14346 if self.Security_Attributes is not None:
14347 showIndent(outfile, level)
14348 outfile.write('<%sSecurity_Attributes>%s</%sSecurity_Attributes>\n' % (namespace_, self.gds_format_string(quote_xml(self.Security_Attributes).encode(ExternalEncoding), input_name='Security_Attributes'), namespace_))
14349 if self.Event_Type is not None:
14350 showIndent(outfile, level)
14351 outfile.write('<%sEvent_Type>%s</%sEvent_Type>\n' % (namespace_, self.gds_format_string(quote_xml(self.Event_Type).encode(ExternalEncoding), input_name='Event_Type'), namespace_))
14352 if self.Thread_ID is not None:
14353 showIndent(outfile, level)
14354 outfile.write('<%sThread_ID>%s</%sThread_ID>\n' % (namespace_, self.gds_format_integer(self.Thread_ID, input_name='Thread_ID'), namespace_))
14355 if self.Start_Address is not None:
14356 self.Start_Address.export(outfile, level, namespace_, name_='Start_Address')
14357 - def hasContent_(self):
14358 if (
14359 self.Security_Attributes is not None or
14360 self.Event_Type is not None or
14361 self.Thread_ID is not None or
14362 self.Start_Address is not None
14363 ):
14364 return True
14365 else:
14366 return False
14367 - def exportLiteral(self, outfile, level, name_='IPC_Object_AttributesType'):
14375 if self.Security_Attributes is not None:
14376 showIndent(outfile, level)
14377 outfile.write('Security_Attributes=%s,\n' % quote_python(self.Security_Attributes).encode(ExternalEncoding))
14378 if self.Event_Type is not None:
14379 showIndent(outfile, level)
14380 outfile.write('Event_Type=%s,\n' % quote_python(self.Event_Type).encode(ExternalEncoding))
14381 if self.Thread_ID is not None:
14382 showIndent(outfile, level)
14383 outfile.write('Thread_ID=%d,\n' % self.Thread_ID)
14384 if self.Start_Address is not None:
14385 showIndent(outfile, level)
14386 outfile.write('Start_Address=model_.xs_hexBinary(\n')
14387 self.Start_Address.exportLiteral(outfile, level, name_='Start_Address')
14388 showIndent(outfile, level)
14389 outfile.write('),\n')
14390 - def build(self, node):
14397 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
14398 if nodeName_ == 'Security_Attributes':
14399 Security_Attributes_ = child_.text
14400 Security_Attributes_ = self.gds_validate_string(Security_Attributes_, node, 'Security_Attributes')
14401 self.Security_Attributes = Security_Attributes_
14402 elif nodeName_ == 'Event_Type':
14403 Event_Type_ = child_.text
14404 Event_Type_ = self.gds_validate_string(Event_Type_, node, 'Event_Type')
14405 self.Event_Type = Event_Type_
14406 elif nodeName_ == 'Thread_ID':
14407 sval_ = child_.text
14408 try:
14409 ival_ = int(sval_)
14410 except (TypeError, ValueError) as e:
14411 raise_parse_error(child_, 'requires integer: %s' % e)
14412 ival_ = self.gds_validate_integer(ival_, node, 'Thread_ID')
14413 self.Thread_ID = ival_
14414 elif nodeName_ == 'Start_Address':
14415 obj_ = xs_hexBinary.factory()
14416 obj_.build(child_)
14417 self.set_Start_Address(obj_)
14418
14419
14420
14422 """The Event_Type field contains the event type of an IPC event object.
14423 Possible values: Manual_Reset, Auto_Reset."""
14424 subclass = None
14425 superclass = None
14433 factory = staticmethod(factory)
14434 - def export(self, outfile, level, namespace_='maec:', name_='Event_Type', namespacedef_=''):
14435 showIndent(outfile, level)
14436 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
14437 already_processed = []
14438 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Event_Type')
14439 if self.hasContent_():
14440 outfile.write('>\n')
14441 self.exportChildren(outfile, level + 1, namespace_, name_)
14442 outfile.write('</%s%s>\n' % (namespace_, name_))
14443 else:
14444 outfile.write('/>\n')
14445 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Event_Type'):
14447 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Event_Type', fromsubclass_=False):
14449 - def hasContent_(self):
14450 if (
14451
14452 ):
14453 return True
14454 else:
14455 return False
14465 - def build(self, node):
14472 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
14474
14475
14476
14478 subclass = None
14479 superclass = None
14480 - def __init__(self, URI=None, AS_Number=None):
14481 self.URI = URI
14482 self.AS_Number = AS_Number
14488 factory = staticmethod(factory)
14489 - def get_URI(self): return self.URI
14490 - def set_URI(self, URI): self.URI = URI
14492 - def set_AS_Number(self, AS_Number): self.AS_Number = AS_Number
14493 - def export(self, outfile, level, namespace_='maec:', name_='Internet_Object_AttributesType', namespacedef_=''):
14494 showIndent(outfile, level)
14495 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
14496 already_processed = []
14497 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Internet_Object_AttributesType')
14498 if self.hasContent_():
14499 outfile.write('>\n')
14500 self.exportChildren(outfile, level + 1, namespace_, name_)
14501 showIndent(outfile, level)
14502 outfile.write('</%s%s>\n' % (namespace_, name_))
14503 else:
14504 outfile.write('/>\n')
14505 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Internet_Object_AttributesType'):
14507 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Internet_Object_AttributesType', fromsubclass_=False):
14508 if self.URI is not None:
14509 self.URI.export(outfile, level, namespace_, name_='URI')
14510 if self.AS_Number is not None:
14511 showIndent(outfile, level)
14512 outfile.write('<%sAS_Number>%s</%sAS_Number>\n' % (namespace_, self.gds_format_integer(self.AS_Number, input_name='AS_Number'), namespace_))
14513 - def hasContent_(self):
14514 if (
14515 self.URI is not None or
14516 self.AS_Number is not None
14517 ):
14518 return True
14519 else:
14520 return False
14521 - def exportLiteral(self, outfile, level, name_='Internet_Object_AttributesType'):
14529 if self.URI is not None:
14530 showIndent(outfile, level)
14531 outfile.write('URI=model_.uriObject(\n')
14532 self.URI.exportLiteral(outfile, level, name_='URI')
14533 showIndent(outfile, level)
14534 outfile.write('),\n')
14535 if self.AS_Number is not None:
14536 showIndent(outfile, level)
14537 outfile.write('AS_Number=%d,\n' % self.AS_Number)
14538 - def build(self, node):
14545 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
14546 if nodeName_ == 'URI':
14547 obj_ = uriObject.factory()
14548 obj_.build(child_)
14549 self.set_URI(obj_)
14550 elif nodeName_ == 'AS_Number':
14551 sval_ = child_.text
14552 try:
14553 ival_ = int(sval_)
14554 except (TypeError, ValueError) as e:
14555 raise_parse_error(child_, 'requires integer: %s' % e)
14556 ival_ = self.gds_validate_integer(ival_, node, 'AS_Number')
14557 self.AS_Number = ival_
14558
14559
14560
14562 subclass = None
14563 superclass = None
14564 - def __init__(self, Library_Type=None, Library_File_Name=None, Version=None):
14573 factory = staticmethod(factory)
14579 - def set_Version(self, Version): self.Version = Version
14580 - def export(self, outfile, level, namespace_='maec:', name_='Module_Object_AttributesType', namespacedef_=''):
14581 showIndent(outfile, level)
14582 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
14583 already_processed = []
14584 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Module_Object_AttributesType')
14585 if self.hasContent_():
14586 outfile.write('>\n')
14587 self.exportChildren(outfile, level + 1, namespace_, name_)
14588 showIndent(outfile, level)
14589 outfile.write('</%s%s>\n' % (namespace_, name_))
14590 else:
14591 outfile.write('/>\n')
14592 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Module_Object_AttributesType'):
14594 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Module_Object_AttributesType', fromsubclass_=False):
14595 if self.Library_Type is not None:
14596 showIndent(outfile, level)
14597 outfile.write('<%sLibrary_Type>%s</%sLibrary_Type>\n' % (namespace_, self.gds_format_string(quote_xml(self.Library_Type).encode(ExternalEncoding), input_name='Library_Type'), namespace_))
14598 if self.Library_File_Name is not None:
14599 showIndent(outfile, level)
14600 outfile.write('<%sLibrary_File_Name>%s</%sLibrary_File_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.Library_File_Name).encode(ExternalEncoding), input_name='Library_File_Name'), namespace_))
14601 if self.Version is not None:
14602 showIndent(outfile, level)
14603 outfile.write('<%sVersion>%s</%sVersion>\n' % (namespace_, self.gds_format_string(quote_xml(self.Version).encode(ExternalEncoding), input_name='Version'), namespace_))
14604 - def hasContent_(self):
14605 if (
14606 self.Library_Type is not None or
14607 self.Library_File_Name is not None or
14608 self.Version is not None
14609 ):
14610 return True
14611 else:
14612 return False
14613 - def exportLiteral(self, outfile, level, name_='Module_Object_AttributesType'):
14630 - def build(self, node):
14637 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
14638 if nodeName_ == 'Library_Type':
14639 Library_Type_ = child_.text
14640 Library_Type_ = self.gds_validate_string(Library_Type_, node, 'Library_Type')
14641 self.Library_Type = Library_Type_
14642 elif nodeName_ == 'Library_File_Name':
14643 Library_File_Name_ = child_.text
14644 Library_File_Name_ = self.gds_validate_string(Library_File_Name_, node, 'Library_File_Name')
14645 self.Library_File_Name = Library_File_Name_
14646 elif nodeName_ == 'Version':
14647 Version_ = child_.text
14648 Version_ = self.gds_validate_string(Version_, node, 'Version')
14649 self.Version = Version_
14650
14651
14652
14654 """The Library_Type field contains the type of library object that is
14655 being characterized. Possible values: Static, Dynamic, Shared,
14656 Remote, Other."""
14657 subclass = None
14658 superclass = None
14666 factory = staticmethod(factory)
14667 - def export(self, outfile, level, namespace_='maec:', name_='Library_Type', namespacedef_=''):
14668 showIndent(outfile, level)
14669 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
14670 already_processed = []
14671 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Library_Type')
14672 if self.hasContent_():
14673 outfile.write('>\n')
14674 self.exportChildren(outfile, level + 1, namespace_, name_)
14675 outfile.write('</%s%s>\n' % (namespace_, name_))
14676 else:
14677 outfile.write('/>\n')
14678 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Library_Type'):
14680 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Library_Type', fromsubclass_=False):
14682 - def hasContent_(self):
14683 if (
14684
14685 ):
14686 return True
14687 else:
14688 return False
14689 - def exportLiteral(self, outfile, level, name_='Library_Type'):
14698 - def build(self, node):
14705 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
14707
14708
14709
14711 subclass = None
14712 superclass = None
14713 - def __init__(self, Hive=None, Key=None, Value=None):
14714 self.Hive = Hive
14715 self.Key = Key
14716 self.Value = Value
14722 factory = staticmethod(factory)
14724 - def set_Hive(self, Hive): self.Hive = Hive
14725 - def get_Key(self): return self.Key
14726 - def set_Key(self, Key): self.Key = Key
14728 - def set_Value(self, Value): self.Value = Value
14729 - def export(self, outfile, level, namespace_='maec:', name_='Registry_Object_AttributesType', namespacedef_=''):
14730 showIndent(outfile, level)
14731 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
14732 already_processed = []
14733 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Registry_Object_AttributesType')
14734 if self.hasContent_():
14735 outfile.write('>\n')
14736 self.exportChildren(outfile, level + 1, namespace_, name_)
14737 showIndent(outfile, level)
14738 outfile.write('</%s%s>\n' % (namespace_, name_))
14739 else:
14740 outfile.write('/>\n')
14741 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Registry_Object_AttributesType'):
14743 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Registry_Object_AttributesType', fromsubclass_=False):
14744 if self.Hive is not None:
14745 showIndent(outfile, level)
14746 outfile.write('<%sHive>%s</%sHive>\n' % (namespace_, self.gds_format_string(quote_xml(self.Hive).encode(ExternalEncoding), input_name='Hive'), namespace_))
14747 if self.Key is not None:
14748 showIndent(outfile, level)
14749 outfile.write('<%sKey>%s</%sKey>\n' % (namespace_, self.gds_format_string(quote_xml(self.Key).encode(ExternalEncoding), input_name='Key'), namespace_))
14750 if self.Value is not None:
14751 self.Value.export(outfile, level, namespace_, name_='Value')
14752 - def hasContent_(self):
14753 if (
14754 self.Hive is not None or
14755 self.Key is not None or
14756 self.Value is not None
14757 ):
14758 return True
14759 else:
14760 return False
14761 - def exportLiteral(self, outfile, level, name_='Registry_Object_AttributesType'):
14781 - def build(self, node):
14788 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
14789 if nodeName_ == 'Hive':
14790 Hive_ = child_.text
14791 Hive_ = self.gds_validate_string(Hive_, node, 'Hive')
14792 self.Hive = Hive_
14793 elif nodeName_ == 'Key':
14794 Key_ = child_.text
14795 Key_ = self.gds_validate_string(Key_, node, 'Key')
14796 self.Key = Key_
14797 elif nodeName_ == 'Value':
14798 obj_ = ValueType.factory()
14799 obj_.build(child_)
14800 self.set_Value(obj_)
14801
14802
14803
14805 """This field refers to the data type of the registry value being
14806 characterized in this element. Possible values: REG_NONE,
14807 REG_SZ, REG_EXPAND, REG_BINARY, REG_DWORD,
14808 REG_DWORD_LITTLE_ENDIAN, REG_DWORD_BIG_ENDIAN, REG_LINK,
14809 REG_MULTI_SZ, REG_RESOURCE_LIST, REG_FULL_RESOURCE_DESCRIPTOR,
14810 REG_RESOURCE_REQUIREMENTS_LIST, REG_QWORD,
14811 REG_QWORD_LITTLE_ENDIAN."""
14812 subclass = None
14813 superclass = None
14814 - def __init__(self, type_=None, Value_Name=None, Value_Data=None):
14815 self.type_ = _cast(None, type_)
14816 self.Value_Name = Value_Name
14817 self.Value_Data = Value_Data
14823 factory = staticmethod(factory)
14828 - def get_type(self): return self.type_
14829 - def set_type(self, type_): self.type_ = type_
14830 - def export(self, outfile, level, namespace_='maec:', name_='ValueType', namespacedef_=''):
14831 showIndent(outfile, level)
14832 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
14833 already_processed = []
14834 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ValueType')
14835 if self.hasContent_():
14836 outfile.write('>\n')
14837 self.exportChildren(outfile, level + 1, namespace_, name_)
14838 showIndent(outfile, level)
14839 outfile.write('</%s%s>\n' % (namespace_, name_))
14840 else:
14841 outfile.write('/>\n')
14842 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ValueType'):
14843 if self.type_ is not None and 'type_' not in already_processed:
14844 already_processed.append('type_')
14845 outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))
14846 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ValueType', fromsubclass_=False):
14853 - def hasContent_(self):
14854 if (
14855 self.Value_Name is not None or
14856 self.Value_Data is not None
14857 ):
14858 return True
14859 else:
14860 return False
14867 if self.type_ is not None and 'type_' not in already_processed:
14868 already_processed.append('type_')
14869 showIndent(outfile, level)
14870 outfile.write('type_ = "%s",\n' % (self.type_,))
14878 - def build(self, node):
14884 value = find_attr_value_('type', node)
14885 if value is not None and 'type' not in already_processed:
14886 already_processed.append('type')
14887 self.type_ = value
14888 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
14889 if nodeName_ == 'Value_Name':
14890 Value_Name_ = child_.text
14891 Value_Name_ = self.gds_validate_string(Value_Name_, node, 'Value_Name')
14892 self.Value_Name = Value_Name_
14893 elif nodeName_ == 'Value_Data':
14894 Value_Data_ = child_.text
14895 Value_Data_ = self.gds_validate_string(Value_Data_, node, 'Value_Data')
14896 self.Value_Data = Value_Data_
14897
14898
14899
14901 subclass = None
14902 superclass = None
14903 - def __init__(self, Image_Name=None, Start_Username=None, Current_Directory=None, Command_Line=None, Security_Attributes=None, Process_ID=None, Start_Address=None, Parent_Process=None, Start_DateTime=None, Child_Processes=None, Handles=None):
14904 self.Image_Name = Image_Name
14905 self.Start_Username = Start_Username
14906 self.Current_Directory = Current_Directory
14907 self.Command_Line = Command_Line
14908 self.Security_Attributes = Security_Attributes
14909 self.Process_ID = Process_ID
14910 self.Start_Address = Start_Address
14911 self.Parent_Process = Parent_Process
14912 self.Start_DateTime = Start_DateTime
14913 self.Child_Processes = Child_Processes
14914 self.Handles = Handles
14920 factory = staticmethod(factory)
14942 - def set_Handles(self, Handles): self.Handles = Handles
14943 - def export(self, outfile, level, namespace_='maec:', name_='Process_Object_AttributesType', namespacedef_=''):
14944 showIndent(outfile, level)
14945 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
14946 already_processed = []
14947 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Process_Object_AttributesType')
14948 if self.hasContent_():
14949 outfile.write('>\n')
14950 self.exportChildren(outfile, level + 1, namespace_, name_)
14951 showIndent(outfile, level)
14952 outfile.write('</%s%s>\n' % (namespace_, name_))
14953 else:
14954 outfile.write('/>\n')
14955 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Process_Object_AttributesType'):
14957 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Process_Object_AttributesType', fromsubclass_=False):
14958 if self.Image_Name is not None:
14959 showIndent(outfile, level)
14960 outfile.write('<%sImage_Name>%s</%sImage_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.Image_Name).encode(ExternalEncoding), input_name='Image_Name'), namespace_))
14961 if self.Start_Username is not None:
14962 showIndent(outfile, level)
14963 outfile.write('<%sStart_Username>%s</%sStart_Username>\n' % (namespace_, self.gds_format_string(quote_xml(self.Start_Username).encode(ExternalEncoding), input_name='Start_Username'), namespace_))
14964 if self.Current_Directory is not None:
14965 showIndent(outfile, level)
14966 outfile.write('<%sCurrent_Directory>%s</%sCurrent_Directory>\n' % (namespace_, self.gds_format_string(quote_xml(self.Current_Directory).encode(ExternalEncoding), input_name='Current_Directory'), namespace_))
14967 if self.Command_Line is not None:
14968 showIndent(outfile, level)
14969 outfile.write('<%sCommand_Line>%s</%sCommand_Line>\n' % (namespace_, self.gds_format_string(quote_xml(self.Command_Line).encode(ExternalEncoding), input_name='Command_Line'), namespace_))
14970 if self.Security_Attributes is not None:
14971 showIndent(outfile, level)
14972 outfile.write('<%sSecurity_Attributes>%s</%sSecurity_Attributes>\n' % (namespace_, self.gds_format_string(quote_xml(self.Security_Attributes).encode(ExternalEncoding), input_name='Security_Attributes'), namespace_))
14973 if self.Process_ID is not None:
14974 showIndent(outfile, level)
14975 outfile.write('<%sProcess_ID>%s</%sProcess_ID>\n' % (namespace_, self.gds_format_string(quote_xml(self.Process_ID).encode(ExternalEncoding), input_name='Process_ID'), namespace_))
14976 if self.Start_Address is not None:
14977 self.Start_Address.export(outfile, level, namespace_, name_='Start_Address')
14978 if self.Parent_Process is not None:
14979 self.Parent_Process.export(outfile, level, namespace_, name_='Parent_Process')
14980 if self.Start_DateTime is not None:
14981 showIndent(outfile, level)
14982 outfile.write('<%sStart_DateTime>%s</%sStart_DateTime>\n' % (namespace_, self.gds_format_string(quote_xml(self.Start_DateTime).encode(ExternalEncoding), input_name='Start_DateTime'), namespace_))
14983 if self.Child_Processes is not None:
14984 self.Child_Processes.export(outfile, level, namespace_, name_='Child_Processes')
14985 if self.Handles is not None:
14986 self.Handles.export(outfile, level, namespace_, name_='Handles')
14987 - def hasContent_(self):
14988 if (
14989 self.Image_Name is not None or
14990 self.Start_Username is not None or
14991 self.Current_Directory is not None or
14992 self.Command_Line is not None or
14993 self.Security_Attributes is not None or
14994 self.Process_ID is not None or
14995 self.Start_Address is not None or
14996 self.Parent_Process is not None or
14997 self.Start_DateTime is not None or
14998 self.Child_Processes is not None or
14999 self.Handles is not None
15000 ):
15001 return True
15002 else:
15003 return False
15004 - def exportLiteral(self, outfile, level, name_='Process_Object_AttributesType'):
15012 if self.Image_Name is not None:
15013 showIndent(outfile, level)
15014 outfile.write('Image_Name=%s,\n' % quote_python(self.Image_Name).encode(ExternalEncoding))
15015 if self.Start_Username is not None:
15016 showIndent(outfile, level)
15017 outfile.write('Start_Username=%s,\n' % quote_python(self.Start_Username).encode(ExternalEncoding))
15018 if self.Current_Directory is not None:
15019 showIndent(outfile, level)
15020 outfile.write('Current_Directory=%s,\n' % quote_python(self.Current_Directory).encode(ExternalEncoding))
15021 if self.Command_Line is not None:
15022 showIndent(outfile, level)
15023 outfile.write('Command_Line=%s,\n' % quote_python(self.Command_Line).encode(ExternalEncoding))
15024 if self.Security_Attributes is not None:
15025 showIndent(outfile, level)
15026 outfile.write('Security_Attributes=%s,\n' % quote_python(self.Security_Attributes).encode(ExternalEncoding))
15027 if self.Process_ID is not None:
15028 showIndent(outfile, level)
15029 outfile.write('Process_ID=%s,\n' % quote_python(self.Process_ID).encode(ExternalEncoding))
15030 if self.Start_Address is not None:
15031 showIndent(outfile, level)
15032 outfile.write('Start_Address=model_.xs_hexBinary(\n')
15033 self.Start_Address.exportLiteral(outfile, level, name_='Start_Address')
15034 showIndent(outfile, level)
15035 outfile.write('),\n')
15036 if self.Parent_Process is not None:
15037 showIndent(outfile, level)
15038 outfile.write('Parent_Process=model_.ObjectReferenceType(\n')
15039 self.Parent_Process.exportLiteral(outfile, level, name_='Parent_Process')
15040 showIndent(outfile, level)
15041 outfile.write('),\n')
15042 if self.Start_DateTime is not None:
15043 showIndent(outfile, level)
15044 outfile.write('Start_DateTime=%s,\n' % quote_python(self.Start_DateTime).encode(ExternalEncoding))
15045 if self.Child_Processes is not None:
15046 showIndent(outfile, level)
15047 outfile.write('Child_Processes=model_.Child_ProcessesType(\n')
15048 self.Child_Processes.exportLiteral(outfile, level, name_='Child_Processes')
15049 showIndent(outfile, level)
15050 outfile.write('),\n')
15051 if self.Handles is not None:
15052 showIndent(outfile, level)
15053 outfile.write('Handles=model_.HandlesType(\n')
15054 self.Handles.exportLiteral(outfile, level, name_='Handles')
15055 showIndent(outfile, level)
15056 outfile.write('),\n')
15057 - def build(self, node):
15064 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
15065 if nodeName_ == 'Image_Name':
15066 Image_Name_ = child_.text
15067 Image_Name_ = self.gds_validate_string(Image_Name_, node, 'Image_Name')
15068 self.Image_Name = Image_Name_
15069 elif nodeName_ == 'Start_Username':
15070 Start_Username_ = child_.text
15071 Start_Username_ = self.gds_validate_string(Start_Username_, node, 'Start_Username')
15072 self.Start_Username = Start_Username_
15073 elif nodeName_ == 'Current_Directory':
15074 Current_Directory_ = child_.text
15075 Current_Directory_ = self.gds_validate_string(Current_Directory_, node, 'Current_Directory')
15076 self.Current_Directory = Current_Directory_
15077 elif nodeName_ == 'Command_Line':
15078 Command_Line_ = child_.text
15079 Command_Line_ = self.gds_validate_string(Command_Line_, node, 'Command_Line')
15080 self.Command_Line = Command_Line_
15081 elif nodeName_ == 'Security_Attributes':
15082 Security_Attributes_ = child_.text
15083 Security_Attributes_ = self.gds_validate_string(Security_Attributes_, node, 'Security_Attributes')
15084 self.Security_Attributes = Security_Attributes_
15085 elif nodeName_ == 'Process_ID':
15086 Process_ID_ = child_.text
15087 Process_ID_ = self.gds_validate_string(Process_ID_, node, 'Process_ID')
15088 self.Process_ID = Process_ID_
15089 elif nodeName_ == 'Start_Address':
15090 obj_ = xs_hexBinary.factory()
15091 obj_.build(child_)
15092 self.set_Start_Address(obj_)
15093 elif nodeName_ == 'Parent_Process':
15094 obj_ = ObjectReferenceType.factory()
15095 obj_.build(child_)
15096 self.set_Parent_Process(obj_)
15097 elif nodeName_ == 'Start_DateTime':
15098 Start_DateTime_ = child_.text
15099 Start_DateTime_ = self.gds_validate_string(Start_DateTime_, node, 'Start_DateTime')
15100 self.Start_DateTime = Start_DateTime_
15101 elif nodeName_ == 'Child_Processes':
15102 obj_ = Child_ProcessesType.factory()
15103 obj_.build(child_)
15104 self.set_Child_Processes(obj_)
15105 elif nodeName_ == 'Handles':
15106 obj_ = HandlesType.factory()
15107 obj_.build(child_)
15108 self.set_Handles(obj_)
15109
15110
15111
15113 subclass = None
15114 superclass = None
15115 - def __init__(self, Child_Process=None):
15116 if Child_Process is None:
15117 self.Child_Process = []
15118 else:
15119 self.Child_Process = Child_Process
15125 factory = staticmethod(factory)
15130 - def export(self, outfile, level, namespace_='maec:', name_='Child_ProcessesType', namespacedef_=''):
15131 showIndent(outfile, level)
15132 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
15133 already_processed = []
15134 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Child_ProcessesType')
15135 if self.hasContent_():
15136 outfile.write('>\n')
15137 self.exportChildren(outfile, level + 1, namespace_, name_)
15138 showIndent(outfile, level)
15139 outfile.write('</%s%s>\n' % (namespace_, name_))
15140 else:
15141 outfile.write('/>\n')
15142 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Child_ProcessesType'):
15144 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Child_ProcessesType', fromsubclass_=False):
15145 for Child_Process_ in self.Child_Process:
15146 Child_Process_.export(outfile, level, namespace_, name_='Child_Process')
15147 - def hasContent_(self):
15148 if (
15149 self.Child_Process
15150 ):
15151 return True
15152 else:
15153 return False
15154 - def exportLiteral(self, outfile, level, name_='Child_ProcessesType'):
15162 showIndent(outfile, level)
15163 outfile.write('Child_Process=[\n')
15164 level += 1
15165 for Child_Process_ in self.Child_Process:
15166 showIndent(outfile, level)
15167 outfile.write('model_.ObjectReferenceType(\n')
15168 Child_Process_.exportLiteral(outfile, level, name_='ObjectReferenceType')
15169 showIndent(outfile, level)
15170 outfile.write('),\n')
15171 level -= 1
15172 showIndent(outfile, level)
15173 outfile.write('],\n')
15174 - def build(self, node):
15181 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
15186
15187
15188
15190 subclass = None
15191 superclass = None
15193 if Handle is None:
15194 self.Handle = []
15195 else:
15196 self.Handle = Handle
15202 factory = staticmethod(factory)
15204 - def set_Handle(self, Handle): self.Handle = Handle
15205 - def add_Handle(self, value): self.Handle.append(value)
15206 - def insert_Handle(self, index, value): self.Handle[index] = value
15207 - def export(self, outfile, level, namespace_='maec:', name_='HandlesType', namespacedef_=''):
15208 showIndent(outfile, level)
15209 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
15210 already_processed = []
15211 self.exportAttributes(outfile, level, already_processed, namespace_, name_='HandlesType')
15212 if self.hasContent_():
15213 outfile.write('>\n')
15214 self.exportChildren(outfile, level + 1, namespace_, name_)
15215 showIndent(outfile, level)
15216 outfile.write('</%s%s>\n' % (namespace_, name_))
15217 else:
15218 outfile.write('/>\n')
15219 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='HandlesType'):
15221 - def exportChildren(self, outfile, level, namespace_='maec:', name_='HandlesType', fromsubclass_=False):
15222 for Handle_ in self.Handle:
15223 Handle_.export(outfile, level, namespace_, name_='Handle')
15224 - def hasContent_(self):
15225 if (
15226 self.Handle
15227 ):
15228 return True
15229 else:
15230 return False
15239 showIndent(outfile, level)
15240 outfile.write('Handle=[\n')
15241 level += 1
15242 for Handle_ in self.Handle:
15243 showIndent(outfile, level)
15244 outfile.write('model_.HandleType(\n')
15245 Handle_.exportLiteral(outfile, level, name_='HandleType')
15246 showIndent(outfile, level)
15247 outfile.write('),\n')
15248 level -= 1
15249 showIndent(outfile, level)
15250 outfile.write('],\n')
15251 - def build(self, node):
15258 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
15259 if nodeName_ == 'Handle':
15260 obj_ = HandleType.factory()
15261 obj_.build(child_)
15262 self.Handle.append(obj_)
15263
15264
15265
15267 subclass = None
15268 superclass = None
15276 factory = staticmethod(factory)
15278 - def set_Name(self, Name): self.Name = Name
15279 - def export(self, outfile, level, namespace_='maec:', name_='HandleType', namespacedef_=''):
15280 showIndent(outfile, level)
15281 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
15282 already_processed = []
15283 self.exportAttributes(outfile, level, already_processed, namespace_, name_='HandleType')
15284 if self.hasContent_():
15285 outfile.write('>\n')
15286 self.exportChildren(outfile, level + 1, namespace_, name_)
15287 showIndent(outfile, level)
15288 outfile.write('</%s%s>\n' % (namespace_, name_))
15289 else:
15290 outfile.write('/>\n')
15291 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='HandleType'):
15293 - def exportChildren(self, outfile, level, namespace_='maec:', name_='HandleType', fromsubclass_=False):
15294 if self.Name is not None:
15295 showIndent(outfile, level)
15296 outfile.write('<%sName>%s</%sName>\n' % (namespace_, self.gds_format_integer(self.Name, input_name='Name'), namespace_))
15297 - def hasContent_(self):
15298 if (
15299 self.Name is not None
15300 ):
15301 return True
15302 else:
15303 return False
15312 if self.Name is not None:
15313 showIndent(outfile, level)
15314 outfile.write('Name=%d,\n' % self.Name)
15315 - def build(self, node):
15322 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
15323 if nodeName_ == 'Name':
15324 sval_ = child_.text
15325 try:
15326 ival_ = int(sval_)
15327 except (TypeError, ValueError) as e:
15328 raise_parse_error(child_, 'requires integer: %s' % e)
15329 ival_ = self.gds_validate_integer(ival_, node, 'Name')
15330 self.Name = ival_
15331
15332
15333
15335 subclass = None
15336 superclass = None
15337 - def __init__(self, Memory_Block_ID=None, Start_Address=None):
15338 self.Memory_Block_ID = Memory_Block_ID
15339 self.Start_Address = Start_Address
15345 factory = staticmethod(factory)
15350 - def export(self, outfile, level, namespace_='maec:', name_='Memory_Object_AttributesType', namespacedef_=''):
15351 showIndent(outfile, level)
15352 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
15353 already_processed = []
15354 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Memory_Object_AttributesType')
15355 if self.hasContent_():
15356 outfile.write('>\n')
15357 self.exportChildren(outfile, level + 1, namespace_, name_)
15358 showIndent(outfile, level)
15359 outfile.write('</%s%s>\n' % (namespace_, name_))
15360 else:
15361 outfile.write('/>\n')
15362 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Memory_Object_AttributesType'):
15364 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Memory_Object_AttributesType', fromsubclass_=False):
15365 if self.Memory_Block_ID is not None:
15366 showIndent(outfile, level)
15367 outfile.write('<%sMemory_Block_ID>%s</%sMemory_Block_ID>\n' % (namespace_, self.gds_format_string(quote_xml(self.Memory_Block_ID).encode(ExternalEncoding), input_name='Memory_Block_ID'), namespace_))
15368 if self.Start_Address is not None:
15369 self.Start_Address.export(outfile, level, namespace_, name_='Start_Address')
15370 - def hasContent_(self):
15371 if (
15372 self.Memory_Block_ID is not None or
15373 self.Start_Address is not None
15374 ):
15375 return True
15376 else:
15377 return False
15378 - def exportLiteral(self, outfile, level, name_='Memory_Object_AttributesType'):
15386 if self.Memory_Block_ID is not None:
15387 showIndent(outfile, level)
15388 outfile.write('Memory_Block_ID=%s,\n' % quote_python(self.Memory_Block_ID).encode(ExternalEncoding))
15389 if self.Start_Address is not None:
15390 showIndent(outfile, level)
15391 outfile.write('Start_Address=model_.xs_hexBinary(\n')
15392 self.Start_Address.exportLiteral(outfile, level, name_='Start_Address')
15393 showIndent(outfile, level)
15394 outfile.write('),\n')
15395 - def build(self, node):
15402 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
15403 if nodeName_ == 'Memory_Block_ID':
15404 Memory_Block_ID_ = child_.text
15405 Memory_Block_ID_ = self.gds_validate_string(Memory_Block_ID_, node, 'Memory_Block_ID')
15406 self.Memory_Block_ID = Memory_Block_ID_
15407 elif nodeName_ == 'Start_Address':
15408 obj_ = xs_hexBinary.factory()
15409 obj_.build(child_)
15410 self.set_Start_Address(obj_)
15411
15412
15413
15415 subclass = None
15416 superclass = None
15417 - def __init__(self, Internal_Port=None, External_Port=None, Socket_Type=None, Socket_ID=None, Internal_IP_Address=None, External_IP_Address=None, IP_Protocol=None, Application_Layer_Protocol=None):
15418 self.Internal_Port = Internal_Port
15419 self.External_Port = External_Port
15420 self.Socket_Type = Socket_Type
15421 self.Socket_ID = Socket_ID
15422 self.Internal_IP_Address = Internal_IP_Address
15423 self.External_IP_Address = External_IP_Address
15424 self.IP_Protocol = IP_Protocol
15425 self.Application_Layer_Protocol = Application_Layer_Protocol
15431 factory = staticmethod(factory)
15439 - def set_Socket_ID(self, Socket_ID): self.Socket_ID = Socket_ID
15454 - def export(self, outfile, level, namespace_='maec:', name_='Network_Object_AttributesType', namespacedef_=''):
15455 showIndent(outfile, level)
15456 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
15457 already_processed = []
15458 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Network_Object_AttributesType')
15459 if self.hasContent_():
15460 outfile.write('>\n')
15461 self.exportChildren(outfile, level + 1, namespace_, name_)
15462 showIndent(outfile, level)
15463 outfile.write('</%s%s>\n' % (namespace_, name_))
15464 else:
15465 outfile.write('/>\n')
15466 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Network_Object_AttributesType'):
15468 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Network_Object_AttributesType', fromsubclass_=False):
15469 if self.Internal_Port is not None:
15470 showIndent(outfile, level)
15471 outfile.write('<%sInternal_Port>%s</%sInternal_Port>\n' % (namespace_, self.gds_format_integer(self.Internal_Port, input_name='Internal_Port'), namespace_))
15472 if self.External_Port is not None:
15473 showIndent(outfile, level)
15474 outfile.write('<%sExternal_Port>%s</%sExternal_Port>\n' % (namespace_, self.gds_format_integer(self.External_Port, input_name='External_Port'), namespace_))
15475 if self.Socket_Type is not None:
15476 showIndent(outfile, level)
15477 outfile.write('<%sSocket_Type>%s</%sSocket_Type>\n' % (namespace_, self.gds_format_string(quote_xml(self.Socket_Type).encode(ExternalEncoding), input_name='Socket_Type'), namespace_))
15478 if self.Socket_ID is not None:
15479 showIndent(outfile, level)
15480 outfile.write('<%sSocket_ID>%s</%sSocket_ID>\n' % (namespace_, self.gds_format_integer(self.Socket_ID, input_name='Socket_ID'), namespace_))
15481 if self.Internal_IP_Address is not None:
15482 self.Internal_IP_Address.export(outfile, level, namespace_, name_='Internal_IP_Address')
15483 if self.External_IP_Address is not None:
15484 self.External_IP_Address.export(outfile, level, namespace_, name_='External_IP_Address')
15485 if self.IP_Protocol is not None:
15486 showIndent(outfile, level)
15487 outfile.write('<%sIP_Protocol>%s</%sIP_Protocol>\n' % (namespace_, self.gds_format_string(quote_xml(self.IP_Protocol).encode(ExternalEncoding), input_name='IP_Protocol'), namespace_))
15488 if self.Application_Layer_Protocol is not None:
15489 showIndent(outfile, level)
15490 outfile.write('<%sApplication_Layer_Protocol>%s</%sApplication_Layer_Protocol>\n' % (namespace_, self.gds_format_string(quote_xml(self.Application_Layer_Protocol).encode(ExternalEncoding), input_name='Application_Layer_Protocol'), namespace_))
15491 - def hasContent_(self):
15492 if (
15493 self.Internal_Port is not None or
15494 self.External_Port is not None or
15495 self.Socket_Type is not None or
15496 self.Socket_ID is not None or
15497 self.Internal_IP_Address is not None or
15498 self.External_IP_Address is not None or
15499 self.IP_Protocol is not None or
15500 self.Application_Layer_Protocol is not None
15501 ):
15502 return True
15503 else:
15504 return False
15505 - def exportLiteral(self, outfile, level, name_='Network_Object_AttributesType'):
15513 if self.Internal_Port is not None:
15514 showIndent(outfile, level)
15515 outfile.write('Internal_Port=%d,\n' % self.Internal_Port)
15516 if self.External_Port is not None:
15517 showIndent(outfile, level)
15518 outfile.write('External_Port=%d,\n' % self.External_Port)
15519 if self.Socket_Type is not None:
15520 showIndent(outfile, level)
15521 outfile.write('Socket_Type=%s,\n' % quote_python(self.Socket_Type).encode(ExternalEncoding))
15522 if self.Socket_ID is not None:
15523 showIndent(outfile, level)
15524 outfile.write('Socket_ID=%d,\n' % self.Socket_ID)
15525 if self.Internal_IP_Address is not None:
15526 showIndent(outfile, level)
15527 outfile.write('Internal_IP_Address=model_.IPAddress(\n')
15528 self.Internal_IP_Address.exportLiteral(outfile, level, name_='Internal_IP_Address')
15529 showIndent(outfile, level)
15530 outfile.write('),\n')
15531 if self.External_IP_Address is not None:
15532 showIndent(outfile, level)
15533 outfile.write('External_IP_Address=model_.IPAddress(\n')
15534 self.External_IP_Address.exportLiteral(outfile, level, name_='External_IP_Address')
15535 showIndent(outfile, level)
15536 outfile.write('),\n')
15537 if self.IP_Protocol is not None:
15538 showIndent(outfile, level)
15539 outfile.write('IP_Protocol=%s,\n' % quote_python(self.IP_Protocol).encode(ExternalEncoding))
15540 if self.Application_Layer_Protocol is not None:
15541 showIndent(outfile, level)
15542 outfile.write('Application_Layer_Protocol=%s,\n' % quote_python(self.Application_Layer_Protocol).encode(ExternalEncoding))
15543 - def build(self, node):
15550 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
15551 if nodeName_ == 'Internal_Port':
15552 sval_ = child_.text
15553 try:
15554 ival_ = int(sval_)
15555 except (TypeError, ValueError) as e:
15556 raise_parse_error(child_, 'requires integer: %s' % e)
15557 ival_ = self.gds_validate_integer(ival_, node, 'Internal_Port')
15558 self.Internal_Port = ival_
15559 elif nodeName_ == 'External_Port':
15560 sval_ = child_.text
15561 try:
15562 ival_ = int(sval_)
15563 except (TypeError, ValueError) as e:
15564 raise_parse_error(child_, 'requires integer: %s' % e)
15565 ival_ = self.gds_validate_integer(ival_, node, 'External_Port')
15566 self.External_Port = ival_
15567 elif nodeName_ == 'Socket_Type':
15568 Socket_Type_ = child_.text
15569 Socket_Type_ = self.gds_validate_string(Socket_Type_, node, 'Socket_Type')
15570 self.Socket_Type = Socket_Type_
15571 elif nodeName_ == 'Socket_ID':
15572 sval_ = child_.text
15573 try:
15574 ival_ = int(sval_)
15575 except (TypeError, ValueError) as e:
15576 raise_parse_error(child_, 'requires integer: %s' % e)
15577 ival_ = self.gds_validate_integer(ival_, node, 'Socket_ID')
15578 self.Socket_ID = ival_
15579 elif nodeName_ == 'Internal_IP_Address':
15580 obj_ = IPAddress.factory()
15581 obj_.build(child_)
15582 self.set_Internal_IP_Address(obj_)
15583 elif nodeName_ == 'External_IP_Address':
15584 obj_ = IPAddress.factory()
15585 obj_.build(child_)
15586 self.set_External_IP_Address(obj_)
15587 elif nodeName_ == 'IP_Protocol':
15588 IP_Protocol_ = child_.text
15589 IP_Protocol_ = self.gds_validate_string(IP_Protocol_, node, 'IP_Protocol')
15590 self.IP_Protocol = IP_Protocol_
15591 self.validate_IPTypeEnum(self.IP_Protocol)
15592 elif nodeName_ == 'Application_Layer_Protocol':
15593 Application_Layer_Protocol_ = child_.text
15594 Application_Layer_Protocol_ = self.gds_validate_string(Application_Layer_Protocol_, node, 'Application_Layer_Protocol')
15595 self.Application_Layer_Protocol = Application_Layer_Protocol_
15596 self.validate_ApplicationProtocolEnum(self.Application_Layer_Protocol)
15597
15598
15599
15601 """The Socket_Type field contains the socket type for socket network
15602 objects. Possible values: Streaming, Datagram, Raw, RDM,
15603 Sequential_Packet, Other."""
15604 subclass = None
15605 superclass = None
15613 factory = staticmethod(factory)
15614 - def export(self, outfile, level, namespace_='maec:', name_='Socket_Type', namespacedef_=''):
15615 showIndent(outfile, level)
15616 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
15617 already_processed = []
15618 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Socket_Type')
15619 if self.hasContent_():
15620 outfile.write('>\n')
15621 self.exportChildren(outfile, level + 1, namespace_, name_)
15622 outfile.write('</%s%s>\n' % (namespace_, name_))
15623 else:
15624 outfile.write('/>\n')
15625 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Socket_Type'):
15627 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Socket_Type', fromsubclass_=False):
15629 - def hasContent_(self):
15630 if (
15631
15632 ):
15633 return True
15634 else:
15635 return False
15645 - def build(self, node):
15652 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
15654
15655
15656
15658 subclass = None
15659 superclass = None
15660 - def __init__(self, Service_Type=None, Start_Type=None, Display_Name=None, Daemon_Binary_Object=None, Load_Order_Group=None):
15661 self.Service_Type = Service_Type
15662 self.Start_Type = Start_Type
15663 self.Display_Name = Display_Name
15664 self.Daemon_Binary_Object = Daemon_Binary_Object
15665 self.Load_Order_Group = Load_Order_Group
15671 factory = staticmethod(factory)
15682 - def export(self, outfile, level, namespace_='maec:', name_='Daemon_Object_AttributesType', namespacedef_=''):
15683 showIndent(outfile, level)
15684 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
15685 already_processed = []
15686 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Daemon_Object_AttributesType')
15687 if self.hasContent_():
15688 outfile.write('>\n')
15689 self.exportChildren(outfile, level + 1, namespace_, name_)
15690 showIndent(outfile, level)
15691 outfile.write('</%s%s>\n' % (namespace_, name_))
15692 else:
15693 outfile.write('/>\n')
15694 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Daemon_Object_AttributesType'):
15696 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Daemon_Object_AttributesType', fromsubclass_=False):
15697 if self.Service_Type is not None:
15698 showIndent(outfile, level)
15699 outfile.write('<%sService_Type>%s</%sService_Type>\n' % (namespace_, self.gds_format_string(quote_xml(self.Service_Type).encode(ExternalEncoding), input_name='Service_Type'), namespace_))
15700 if self.Start_Type is not None:
15701 showIndent(outfile, level)
15702 outfile.write('<%sStart_Type>%s</%sStart_Type>\n' % (namespace_, self.gds_format_string(quote_xml(self.Start_Type).encode(ExternalEncoding), input_name='Start_Type'), namespace_))
15703 if self.Display_Name is not None:
15704 showIndent(outfile, level)
15705 outfile.write('<%sDisplay_Name>%s</%sDisplay_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.Display_Name).encode(ExternalEncoding), input_name='Display_Name'), namespace_))
15706 if self.Daemon_Binary_Object is not None:
15707 self.Daemon_Binary_Object.export(outfile, level, namespace_, name_='Daemon_Binary_Object')
15708 if self.Load_Order_Group is not None:
15709 showIndent(outfile, level)
15710 outfile.write('<%sLoad_Order_Group>%s</%sLoad_Order_Group>\n' % (namespace_, self.gds_format_string(quote_xml(self.Load_Order_Group).encode(ExternalEncoding), input_name='Load_Order_Group'), namespace_))
15711 - def hasContent_(self):
15712 if (
15713 self.Service_Type is not None or
15714 self.Start_Type is not None or
15715 self.Display_Name is not None or
15716 self.Daemon_Binary_Object is not None or
15717 self.Load_Order_Group is not None
15718 ):
15719 return True
15720 else:
15721 return False
15722 - def exportLiteral(self, outfile, level, name_='Daemon_Object_AttributesType'):
15730 if self.Service_Type is not None:
15731 showIndent(outfile, level)
15732 outfile.write('Service_Type=%s,\n' % quote_python(self.Service_Type).encode(ExternalEncoding))
15733 if self.Start_Type is not None:
15734 showIndent(outfile, level)
15735 outfile.write('Start_Type=%s,\n' % quote_python(self.Start_Type).encode(ExternalEncoding))
15736 if self.Display_Name is not None:
15737 showIndent(outfile, level)
15738 outfile.write('Display_Name=%s,\n' % quote_python(self.Display_Name).encode(ExternalEncoding))
15739 if self.Daemon_Binary_Object is not None:
15740 showIndent(outfile, level)
15741 outfile.write('Daemon_Binary_Object=model_.ObjectType(\n')
15742 self.Daemon_Binary_Object.exportLiteral(outfile, level, name_='Daemon_Binary_Object')
15743 showIndent(outfile, level)
15744 outfile.write('),\n')
15745 if self.Load_Order_Group is not None:
15746 showIndent(outfile, level)
15747 outfile.write('Load_Order_Group=%s,\n' % quote_python(self.Load_Order_Group).encode(ExternalEncoding))
15748 - def build(self, node):
15755 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
15756 if nodeName_ == 'Service_Type':
15757 Service_Type_ = child_.text
15758 Service_Type_ = self.gds_validate_string(Service_Type_, node, 'Service_Type')
15759 self.Service_Type = Service_Type_
15760 elif nodeName_ == 'Start_Type':
15761 Start_Type_ = child_.text
15762 Start_Type_ = self.gds_validate_string(Start_Type_, node, 'Start_Type')
15763 self.Start_Type = Start_Type_
15764 elif nodeName_ == 'Display_Name':
15765 Display_Name_ = child_.text
15766 Display_Name_ = self.gds_validate_string(Display_Name_, node, 'Display_Name')
15767 self.Display_Name = Display_Name_
15768 elif nodeName_ == 'Daemon_Binary_Object':
15769 obj_ = ObjectType.factory()
15770 obj_.build(child_)
15771 self.set_Daemon_Binary_Object(obj_)
15772 elif nodeName_ == 'Load_Order_Group':
15773 Load_Order_Group_ = child_.text
15774 Load_Order_Group_ = self.gds_validate_string(Load_Order_Group_, node, 'Load_Order_Group')
15775 self.Load_Order_Group = Load_Order_Group_
15776
15777
15778
15780 """The Service_Type field contains the type of the service object.
15781 Possible values: SERVICE_ADAPTER, SERVICE_FILE_SYSTEM_DRIVER,
15782 SERVICE_KERNEL_DRIVER, SERVICE_RECOGNIZER_DRIVER,
15783 SERVICE_WIN32_OWN_PROCESS, SERVICE_WIN32_SHARE_PROCESS."""
15784 subclass = None
15785 superclass = None
15793 factory = staticmethod(factory)
15794 - def export(self, outfile, level, namespace_='maec:', name_='Service_Type', namespacedef_=''):
15795 showIndent(outfile, level)
15796 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
15797 already_processed = []
15798 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Service_Type')
15799 if self.hasContent_():
15800 outfile.write('>\n')
15801 self.exportChildren(outfile, level + 1, namespace_, name_)
15802 outfile.write('</%s%s>\n' % (namespace_, name_))
15803 else:
15804 outfile.write('/>\n')
15805 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Service_Type'):
15807 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Service_Type', fromsubclass_=False):
15809 - def hasContent_(self):
15810 if (
15811
15812 ):
15813 return True
15814 else:
15815 return False
15816 - def exportLiteral(self, outfile, level, name_='Service_Type'):
15825 - def build(self, node):
15832 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
15834
15835
15836
15838 subclass = None
15839 superclass = None
15840 - def __init__(self, Custom_Attribute=None):
15841 if Custom_Attribute is None:
15842 self.Custom_Attribute = []
15843 else:
15844 self.Custom_Attribute = Custom_Attribute
15850 factory = staticmethod(factory)
15855 - def export(self, outfile, level, namespace_='maec:', name_='Custom_Object_AttributesType', namespacedef_=''):
15856 showIndent(outfile, level)
15857 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
15858 already_processed = []
15859 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Custom_Object_AttributesType')
15860 if self.hasContent_():
15861 outfile.write('>\n')
15862 self.exportChildren(outfile, level + 1, namespace_, name_)
15863 showIndent(outfile, level)
15864 outfile.write('</%s%s>\n' % (namespace_, name_))
15865 else:
15866 outfile.write('/>\n')
15867 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Custom_Object_AttributesType'):
15869 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Custom_Object_AttributesType', fromsubclass_=False):
15870 for Custom_Attribute_ in self.Custom_Attribute:
15871 Custom_Attribute_.export(outfile, level, namespace_, name_='Custom_Attribute')
15872 - def hasContent_(self):
15873 if (
15874 self.Custom_Attribute
15875 ):
15876 return True
15877 else:
15878 return False
15879 - def exportLiteral(self, outfile, level, name_='Custom_Object_AttributesType'):
15887 showIndent(outfile, level)
15888 outfile.write('Custom_Attribute=[\n')
15889 level += 1
15890 for Custom_Attribute_ in self.Custom_Attribute:
15891 showIndent(outfile, level)
15892 outfile.write('model_.Custom_AttributeType(\n')
15893 Custom_Attribute_.exportLiteral(outfile, level, name_='Custom_AttributeType')
15894 showIndent(outfile, level)
15895 outfile.write('),\n')
15896 level -= 1
15897 showIndent(outfile, level)
15898 outfile.write('],\n')
15899 - def build(self, node):
15906 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
15911
15912
15913
15915 """The custom_attribute_name attribute contains the name of the custom
15916 attribute."""
15917 subclass = None
15918 superclass = None
15919 - def __init__(self, custom_attribute_name=None, valueOf_=None):
15920 self.custom_attribute_name = _cast(None, custom_attribute_name)
15921 self.valueOf_ = valueOf_
15927 factory = staticmethod(factory)
15931 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
15932 - def export(self, outfile, level, namespace_='maec:', name_='Custom_AttributeType', namespacedef_=''):
15933 showIndent(outfile, level)
15934 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
15935 already_processed = []
15936 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Custom_AttributeType')
15937 if self.hasContent_():
15938 outfile.write('>')
15939 outfile.write(str(self.valueOf_).encode(ExternalEncoding))
15940 self.exportChildren(outfile, level + 1, namespace_, name_)
15941 outfile.write('</%s%s>\n' % (namespace_, name_))
15942 else:
15943 outfile.write('/>\n')
15944 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Custom_AttributeType'):
15945 if self.custom_attribute_name is not None and 'custom_attribute_name' not in already_processed:
15946 already_processed.append('custom_attribute_name')
15947 outfile.write(' custom_attribute_name=%s' % (self.gds_format_string(quote_attrib(self.custom_attribute_name).encode(ExternalEncoding), input_name='custom_attribute_name'), ))
15948 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Custom_AttributeType', fromsubclass_=False):
15950 - def hasContent_(self):
15951 if (
15952 self.valueOf_
15953 ):
15954 return True
15955 else:
15956 return False
15957 - def exportLiteral(self, outfile, level, name_='Custom_AttributeType'):
15965 if self.custom_attribute_name is not None and 'custom_attribute_name' not in already_processed:
15966 already_processed.append('custom_attribute_name')
15967 showIndent(outfile, level)
15968 outfile.write('custom_attribute_name = "%s",\n' % (self.custom_attribute_name,))
15971 - def build(self, node):
15978 value = find_attr_value_('custom_attribute_name', node)
15979 if value is not None and 'custom_attribute_name' not in already_processed:
15980 already_processed.append('custom_attribute_name')
15981 self.custom_attribute_name = value
15982 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
15984
15985
15986
15988 subclass = None
15989 superclass = None
15990 - def __init__(self, Affected_Object=None):
15991 if Affected_Object is None:
15992 self.Affected_Object = []
15993 else:
15994 self.Affected_Object = Affected_Object
16000 factory = staticmethod(factory)
16005 - def export(self, outfile, level, namespace_='maec:', name_='Affected_ObjectsType', namespacedef_=''):
16006 showIndent(outfile, level)
16007 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
16008 already_processed = []
16009 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Affected_ObjectsType')
16010 if self.hasContent_():
16011 outfile.write('>\n')
16012 self.exportChildren(outfile, level + 1, namespace_, name_)
16013 showIndent(outfile, level)
16014 outfile.write('</%s%s>\n' % (namespace_, name_))
16015 else:
16016 outfile.write('/>\n')
16017 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Affected_ObjectsType'):
16019 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Affected_ObjectsType', fromsubclass_=False):
16020 for Affected_Object_ in self.Affected_Object:
16021 Affected_Object_.export(outfile, level, namespace_, name_='Affected_Object')
16022 - def hasContent_(self):
16023 if (
16024 self.Affected_Object
16025 ):
16026 return True
16027 else:
16028 return False
16029 - def exportLiteral(self, outfile, level, name_='Affected_ObjectsType'):
16037 showIndent(outfile, level)
16038 outfile.write('Affected_Object=[\n')
16039 level += 1
16040 for Affected_Object_ in self.Affected_Object:
16041 showIndent(outfile, level)
16042 outfile.write('model_.Affected_ObjectType(\n')
16043 Affected_Object_.exportLiteral(outfile, level, name_='Affected_ObjectType')
16044 showIndent(outfile, level)
16045 outfile.write('),\n')
16046 level -= 1
16047 showIndent(outfile, level)
16048 outfile.write('],\n')
16049 - def build(self, node):
16056 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
16061
16062
16063
16065 subclass = None
16066 superclass = None
16067 - def __init__(self, effect_type=None, Object_Reference=None):
16068 self.effect_type = _cast(None, effect_type)
16069 self.Object_Reference = Object_Reference
16075 factory = staticmethod(factory)
16080 - def export(self, outfile, level, namespace_='maec:', name_='Affected_ObjectType', namespacedef_=''):
16081 showIndent(outfile, level)
16082 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
16083 already_processed = []
16084 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Affected_ObjectType')
16085 if self.hasContent_():
16086 outfile.write('>\n')
16087 self.exportChildren(outfile, level + 1, namespace_, name_)
16088 showIndent(outfile, level)
16089 outfile.write('</%s%s>\n' % (namespace_, name_))
16090 else:
16091 outfile.write('/>\n')
16092 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Affected_ObjectType'):
16093 if self.effect_type is not None and 'effect_type' not in already_processed:
16094 already_processed.append('effect_type')
16095 outfile.write(' effect_type=%s' % (quote_attrib(self.effect_type), ))
16096 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Affected_ObjectType', fromsubclass_=False):
16097 if self.Object_Reference is not None:
16098 self.Object_Reference.export(outfile, level, namespace_, name_='Object_Reference', )
16099 - def hasContent_(self):
16100 if (
16101 self.Object_Reference is not None
16102 ):
16103 return True
16104 else:
16105 return False
16106 - def exportLiteral(self, outfile, level, name_='Affected_ObjectType'):
16112 if self.effect_type is not None and 'effect_type' not in already_processed:
16113 already_processed.append('effect_type')
16114 showIndent(outfile, level)
16115 outfile.write('effect_type = %s,\n' % (self.effect_type,))
16117 if self.Object_Reference is not None:
16118 showIndent(outfile, level)
16119 outfile.write('Object_Reference=model_.ObjectReferenceType(\n')
16120 self.Object_Reference.exportLiteral(outfile, level, name_='Object_Reference')
16121 showIndent(outfile, level)
16122 outfile.write('),\n')
16123 - def build(self, node):
16129 value = find_attr_value_('effect_type', node)
16130 if value is not None and 'effect_type' not in already_processed:
16131 already_processed.append('effect_type')
16132 self.effect_type = value
16133 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
16138
16139
16140
16142 subclass = None
16143 superclass = None
16144 - def __init__(self, Effect_Reference=None):
16145 if Effect_Reference is None:
16146 self.Effect_Reference = []
16147 else:
16148 self.Effect_Reference = Effect_Reference
16154 factory = staticmethod(factory)
16159 - def export(self, outfile, level, namespace_='maec:', name_='Constituent_EffectsType', namespacedef_=''):
16160 showIndent(outfile, level)
16161 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
16162 already_processed = []
16163 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Constituent_EffectsType')
16164 if self.hasContent_():
16165 outfile.write('>\n')
16166 self.exportChildren(outfile, level + 1, namespace_, name_)
16167 showIndent(outfile, level)
16168 outfile.write('</%s%s>\n' % (namespace_, name_))
16169 else:
16170 outfile.write('/>\n')
16171 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Constituent_EffectsType'):
16173 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Constituent_EffectsType', fromsubclass_=False):
16174 for Effect_Reference_ in self.Effect_Reference:
16175 Effect_Reference_.export(outfile, level, namespace_, name_='Effect_Reference')
16176 - def hasContent_(self):
16177 if (
16178 self.Effect_Reference
16179 ):
16180 return True
16181 else:
16182 return False
16183 - def exportLiteral(self, outfile, level, name_='Constituent_EffectsType'):
16191 showIndent(outfile, level)
16192 outfile.write('Effect_Reference=[\n')
16193 level += 1
16194 for Effect_Reference_ in self.Effect_Reference:
16195 showIndent(outfile, level)
16196 outfile.write('model_.EffectReferenceType(\n')
16197 Effect_Reference_.exportLiteral(outfile, level, name_='EffectReferenceType')
16198 showIndent(outfile, level)
16199 outfile.write('),\n')
16200 level -= 1
16201 showIndent(outfile, level)
16202 outfile.write('],\n')
16203 - def build(self, node):
16210 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
16215
16216
16217
16219 """This field refers to whether the vulnerability that is being
16220 exploited is known or unknown. Only known vulnerabilities will
16221 have an associated CPE identifier. Possible values: Known,
16222 Unknown."""
16223 subclass = None
16224 superclass = None
16225 - def __init__(self, vulnerability_type=None, Known_Exploit=None):
16226 self.vulnerability_type = _cast(None, vulnerability_type)
16227 self.Known_Exploit = Known_Exploit
16233 factory = staticmethod(factory)
16238 - def export(self, outfile, level, namespace_='maec:', name_='Vulnerability_ExploitType', namespacedef_=''):
16239 showIndent(outfile, level)
16240 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
16241 already_processed = []
16242 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Vulnerability_ExploitType')
16243 if self.hasContent_():
16244 outfile.write('>\n')
16245 self.exportChildren(outfile, level + 1, namespace_, name_)
16246 showIndent(outfile, level)
16247 outfile.write('</%s%s>\n' % (namespace_, name_))
16248 else:
16249 outfile.write('/>\n')
16250 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Vulnerability_ExploitType'):
16251 if self.vulnerability_type is not None and 'vulnerability_type' not in already_processed:
16252 already_processed.append('vulnerability_type')
16253 outfile.write(' vulnerability_type=%s' % (self.gds_format_string(quote_attrib(self.vulnerability_type).encode(ExternalEncoding), input_name='vulnerability_type'), ))
16254 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Vulnerability_ExploitType', fromsubclass_=False):
16255 if self.Known_Exploit is not None:
16256 self.Known_Exploit.export(outfile, level, namespace_, name_='Known_Exploit', )
16257 - def hasContent_(self):
16258 if (
16259 self.Known_Exploit is not None
16260 ):
16261 return True
16262 else:
16263 return False
16264 - def exportLiteral(self, outfile, level, name_='Vulnerability_ExploitType'):
16270 if self.vulnerability_type is not None and 'vulnerability_type' not in already_processed:
16271 already_processed.append('vulnerability_type')
16272 showIndent(outfile, level)
16273 outfile.write('vulnerability_type = "%s",\n' % (self.vulnerability_type,))
16275 if self.Known_Exploit is not None:
16276 showIndent(outfile, level)
16277 outfile.write('Known_Exploit=model_.CVEVulnerabilityType(\n')
16278 self.Known_Exploit.exportLiteral(outfile, level, name_='Known_Exploit')
16279 showIndent(outfile, level)
16280 outfile.write('),\n')
16281 - def build(self, node):
16287 value = find_attr_value_('vulnerability_type', node)
16288 if value is not None and 'vulnerability_type' not in already_processed:
16289 already_processed.append('vulnerability_type')
16290 self.vulnerability_type = value
16291 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
16296
16297
16298
16300 subclass = None
16301 superclass = None
16303 if Image is None:
16304 self.Image = []
16305 else:
16306 self.Image = Image
16312 factory = staticmethod(factory)
16314 - def set_Image(self, Image): self.Image = Image
16315 - def add_Image(self, value): self.Image.append(value)
16316 - def insert_Image(self, index, value): self.Image[index] = value
16317 - def export(self, outfile, level, namespace_='maec:', name_='ImagesType', namespacedef_=''):
16318 showIndent(outfile, level)
16319 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
16320 already_processed = []
16321 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ImagesType')
16322 if self.hasContent_():
16323 outfile.write('>\n')
16324 self.exportChildren(outfile, level + 1, namespace_, name_)
16325 showIndent(outfile, level)
16326 outfile.write('</%s%s>\n' % (namespace_, name_))
16327 else:
16328 outfile.write('/>\n')
16329 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ImagesType'):
16331 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ImagesType', fromsubclass_=False):
16332 for Image_ in self.Image:
16333 Image_.export(outfile, level, namespace_, name_='Image')
16334 - def hasContent_(self):
16335 if (
16336 self.Image
16337 ):
16338 return True
16339 else:
16340 return False
16349 showIndent(outfile, level)
16350 outfile.write('Image=[\n')
16351 level += 1
16352 for Image_ in self.Image:
16353 showIndent(outfile, level)
16354 outfile.write('model_.ImageType(\n')
16355 Image_.exportLiteral(outfile, level, name_='ImageType')
16356 showIndent(outfile, level)
16357 outfile.write('),\n')
16358 level -= 1
16359 showIndent(outfile, level)
16360 outfile.write('],\n')
16361 - def build(self, node):
16368 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
16369 if nodeName_ == 'Image':
16370 obj_ = ImageType.factory()
16371 obj_.build(child_)
16372 self.Image.append(obj_)
16373
16374
16375
16377 subclass = None
16378 superclass = None
16379 - def __init__(self, Image_Location=None, Image_Title=None):
16380 self.Image_Location = Image_Location
16381 self.Image_Title = Image_Title
16387 factory = staticmethod(factory)
16392 - def export(self, outfile, level, namespace_='maec:', name_='ImageType', namespacedef_=''):
16393 showIndent(outfile, level)
16394 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
16395 already_processed = []
16396 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ImageType')
16397 if self.hasContent_():
16398 outfile.write('>\n')
16399 self.exportChildren(outfile, level + 1, namespace_, name_)
16400 showIndent(outfile, level)
16401 outfile.write('</%s%s>\n' % (namespace_, name_))
16402 else:
16403 outfile.write('/>\n')
16404 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ImageType'):
16406 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ImageType', fromsubclass_=False):
16407 if self.Image_Location is not None:
16408 showIndent(outfile, level)
16409 outfile.write('<%sImage_Location>%s</%sImage_Location>\n' % (namespace_, self.gds_format_string(quote_xml(self.Image_Location).encode(ExternalEncoding), input_name='Image_Location'), namespace_))
16410 if self.Image_Title is not None:
16411 showIndent(outfile, level)
16412 outfile.write('<%sImage_Title>%s</%sImage_Title>\n' % (namespace_, self.gds_format_string(quote_xml(self.Image_Title).encode(ExternalEncoding), input_name='Image_Title'), namespace_))
16413 - def hasContent_(self):
16414 if (
16415 self.Image_Location is not None or
16416 self.Image_Title is not None
16417 ):
16418 return True
16419 else:
16420 return False
16435 - def build(self, node):
16442 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
16443 if nodeName_ == 'Image_Location':
16444 Image_Location_ = child_.text
16445 Image_Location_ = self.gds_validate_string(Image_Location_, node, 'Image_Location')
16446 self.Image_Location = Image_Location_
16447 elif nodeName_ == 'Image_Title':
16448 Image_Title_ = child_.text
16449 Image_Title_ = self.gds_validate_string(Image_Title_, node, 'Image_Title')
16450 self.Image_Title = Image_Title_
16451
16452
16453
16455 subclass = None
16456 superclass = None
16458 if Image is None:
16459 self.Image = []
16460 else:
16461 self.Image = Image
16467 factory = staticmethod(factory)
16469 - def set_Image(self, Image): self.Image = Image
16470 - def add_Image(self, value): self.Image.append(value)
16471 - def insert_Image(self, index, value): self.Image[index] = value
16472 - def export(self, outfile, level, namespace_='maec:', name_='ImagesType1', namespacedef_=''):
16473 showIndent(outfile, level)
16474 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
16475 already_processed = []
16476 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ImagesType1')
16477 if self.hasContent_():
16478 outfile.write('>\n')
16479 self.exportChildren(outfile, level + 1, namespace_, name_)
16480 showIndent(outfile, level)
16481 outfile.write('</%s%s>\n' % (namespace_, name_))
16482 else:
16483 outfile.write('/>\n')
16484 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ImagesType1'):
16486 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ImagesType1', fromsubclass_=False):
16487 for Image_ in self.Image:
16488 Image_.export(outfile, level, namespace_, name_='Image')
16489 - def hasContent_(self):
16490 if (
16491 self.Image
16492 ):
16493 return True
16494 else:
16495 return False
16504 showIndent(outfile, level)
16505 outfile.write('Image=[\n')
16506 level += 1
16507 for Image_ in self.Image:
16508 showIndent(outfile, level)
16509 outfile.write('model_.ImageType1(\n')
16510 Image_.exportLiteral(outfile, level, name_='ImageType1')
16511 showIndent(outfile, level)
16512 outfile.write('),\n')
16513 level -= 1
16514 showIndent(outfile, level)
16515 outfile.write('],\n')
16516 - def build(self, node):
16523 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
16524 if nodeName_ == 'Image':
16525 obj_ = ImageType1.factory()
16526 obj_.build(child_)
16527 self.Image.append(obj_)
16528
16529
16530
16532 subclass = None
16533 superclass = None
16534 - def __init__(self, Image_Location=None, Image_Title=None):
16535 self.Image_Location = Image_Location
16536 self.Image_Title = Image_Title
16542 factory = staticmethod(factory)
16547 - def export(self, outfile, level, namespace_='maec:', name_='ImageType1', namespacedef_=''):
16548 showIndent(outfile, level)
16549 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
16550 already_processed = []
16551 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ImageType1')
16552 if self.hasContent_():
16553 outfile.write('>\n')
16554 self.exportChildren(outfile, level + 1, namespace_, name_)
16555 showIndent(outfile, level)
16556 outfile.write('</%s%s>\n' % (namespace_, name_))
16557 else:
16558 outfile.write('/>\n')
16559 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ImageType1'):
16561 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ImageType1', fromsubclass_=False):
16562 if self.Image_Location is not None:
16563 showIndent(outfile, level)
16564 outfile.write('<%sImage_Location>%s</%sImage_Location>\n' % (namespace_, self.gds_format_string(quote_xml(self.Image_Location).encode(ExternalEncoding), input_name='Image_Location'), namespace_))
16565 if self.Image_Title is not None:
16566 showIndent(outfile, level)
16567 outfile.write('<%sImage_Title>%s</%sImage_Title>\n' % (namespace_, self.gds_format_string(quote_xml(self.Image_Title).encode(ExternalEncoding), input_name='Image_Title'), namespace_))
16568 - def hasContent_(self):
16569 if (
16570 self.Image_Location is not None or
16571 self.Image_Title is not None
16572 ):
16573 return True
16574 else:
16575 return False
16590 - def build(self, node):
16597 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
16598 if nodeName_ == 'Image_Location':
16599 Image_Location_ = child_.text
16600 Image_Location_ = self.gds_validate_string(Image_Location_, node, 'Image_Location')
16601 self.Image_Location = Image_Location_
16602 elif nodeName_ == 'Image_Title':
16603 Image_Title_ = child_.text
16604 Image_Title_ = self.gds_validate_string(Image_Title_, node, 'Image_Title')
16605 self.Image_Title = Image_Title_
16606
16607
16608
16610 subclass = None
16611 superclass = None
16613 if Image is None:
16614 self.Image = []
16615 else:
16616 self.Image = Image
16622 factory = staticmethod(factory)
16624 - def set_Image(self, Image): self.Image = Image
16625 - def add_Image(self, value): self.Image.append(value)
16626 - def insert_Image(self, index, value): self.Image[index] = value
16627 - def export(self, outfile, level, namespace_='maec:', name_='ImagesType2', namespacedef_=''):
16628 showIndent(outfile, level)
16629 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
16630 already_processed = []
16631 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ImagesType2')
16632 if self.hasContent_():
16633 outfile.write('>\n')
16634 self.exportChildren(outfile, level + 1, namespace_, name_)
16635 showIndent(outfile, level)
16636 outfile.write('</%s%s>\n' % (namespace_, name_))
16637 else:
16638 outfile.write('/>\n')
16639 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ImagesType2'):
16641 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ImagesType2', fromsubclass_=False):
16642 for Image_ in self.Image:
16643 Image_.export(outfile, level, namespace_, name_='Image')
16644 - def hasContent_(self):
16645 if (
16646 self.Image
16647 ):
16648 return True
16649 else:
16650 return False
16659 showIndent(outfile, level)
16660 outfile.write('Image=[\n')
16661 level += 1
16662 for Image_ in self.Image:
16663 showIndent(outfile, level)
16664 outfile.write('model_.ImageType2(\n')
16665 Image_.exportLiteral(outfile, level, name_='ImageType2')
16666 showIndent(outfile, level)
16667 outfile.write('),\n')
16668 level -= 1
16669 showIndent(outfile, level)
16670 outfile.write('],\n')
16671 - def build(self, node):
16678 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
16679 if nodeName_ == 'Image':
16680 obj_ = ImageType2.factory()
16681 obj_.build(child_)
16682 self.Image.append(obj_)
16683
16684
16685
16687 subclass = None
16688 superclass = None
16689 - def __init__(self, Image_Location=None, Image_Title=None):
16690 self.Image_Location = Image_Location
16691 self.Image_Title = Image_Title
16697 factory = staticmethod(factory)
16702 - def export(self, outfile, level, namespace_='maec:', name_='ImageType2', namespacedef_=''):
16703 showIndent(outfile, level)
16704 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
16705 already_processed = []
16706 self.exportAttributes(outfile, level, already_processed, namespace_, name_='ImageType2')
16707 if self.hasContent_():
16708 outfile.write('>\n')
16709 self.exportChildren(outfile, level + 1, namespace_, name_)
16710 showIndent(outfile, level)
16711 outfile.write('</%s%s>\n' % (namespace_, name_))
16712 else:
16713 outfile.write('/>\n')
16714 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='ImageType2'):
16716 - def exportChildren(self, outfile, level, namespace_='maec:', name_='ImageType2', fromsubclass_=False):
16717 if self.Image_Location is not None:
16718 showIndent(outfile, level)
16719 outfile.write('<%sImage_Location>%s</%sImage_Location>\n' % (namespace_, self.gds_format_string(quote_xml(self.Image_Location).encode(ExternalEncoding), input_name='Image_Location'), namespace_))
16720 if self.Image_Title is not None:
16721 showIndent(outfile, level)
16722 outfile.write('<%sImage_Title>%s</%sImage_Title>\n' % (namespace_, self.gds_format_string(quote_xml(self.Image_Title).encode(ExternalEncoding), input_name='Image_Title'), namespace_))
16723 - def hasContent_(self):
16724 if (
16725 self.Image_Location is not None or
16726 self.Image_Title is not None
16727 ):
16728 return True
16729 else:
16730 return False
16745 - def build(self, node):
16752 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
16753 if nodeName_ == 'Image_Location':
16754 Image_Location_ = child_.text
16755 Image_Location_ = self.gds_validate_string(Image_Location_, node, 'Image_Location')
16756 self.Image_Location = Image_Location_
16757 elif nodeName_ == 'Image_Title':
16758 Image_Title_ = child_.text
16759 Image_Title_ = self.gds_validate_string(Image_Title_, node, 'Image_Title')
16760 self.Image_Title = Image_Title_
16761
16762
16763
16765 subclass = None
16766 superclass = None
16767 - def __init__(self, Existing_File_Name=None, Destination_File_Name=None, Access_Mode=None, Flags=None, Open_Mode=None, File_Attributes=None):
16768 self.Existing_File_Name = Existing_File_Name
16769 self.Destination_File_Name = Destination_File_Name
16770 self.Access_Mode = Access_Mode
16771 self.Flags = Flags
16772 self.Open_Mode = Open_Mode
16773 self.File_Attributes = File_Attributes
16779 factory = staticmethod(factory)
16787 - def set_Flags(self, Flags): self.Flags = Flags
16789 - def set_Open_Mode(self, Open_Mode): self.Open_Mode = Open_Mode
16792 - def export(self, outfile, level, namespace_='maec:', name_='File_System_Action_AttributesType', namespacedef_=''):
16793 showIndent(outfile, level)
16794 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
16795 already_processed = []
16796 self.exportAttributes(outfile, level, already_processed, namespace_, name_='File_System_Action_AttributesType')
16797 if self.hasContent_():
16798 outfile.write('>\n')
16799 self.exportChildren(outfile, level + 1, namespace_, name_)
16800 showIndent(outfile, level)
16801 outfile.write('</%s%s>\n' % (namespace_, name_))
16802 else:
16803 outfile.write('/>\n')
16804 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='File_System_Action_AttributesType'):
16806 - def exportChildren(self, outfile, level, namespace_='maec:', name_='File_System_Action_AttributesType', fromsubclass_=False):
16807 if self.Existing_File_Name is not None:
16808 showIndent(outfile, level)
16809 outfile.write('<%sExisting_File_Name>%s</%sExisting_File_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.Existing_File_Name).encode(ExternalEncoding), input_name='Existing_File_Name'), namespace_))
16810 if self.Destination_File_Name is not None:
16811 showIndent(outfile, level)
16812 outfile.write('<%sDestination_File_Name>%s</%sDestination_File_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.Destination_File_Name).encode(ExternalEncoding), input_name='Destination_File_Name'), namespace_))
16813 if self.Access_Mode is not None:
16814 showIndent(outfile, level)
16815 outfile.write('<%sAccess_Mode>%s</%sAccess_Mode>\n' % (namespace_, self.gds_format_string(quote_xml(self.Access_Mode).encode(ExternalEncoding), input_name='Access_Mode'), namespace_))
16816 if self.Flags is not None:
16817 showIndent(outfile, level)
16818 outfile.write('<%sFlags>%s</%sFlags>\n' % (namespace_, self.gds_format_string(quote_xml(self.Flags).encode(ExternalEncoding), input_name='Flags'), namespace_))
16819 if self.Open_Mode is not None:
16820 showIndent(outfile, level)
16821 outfile.write('<%sOpen_Mode>%s</%sOpen_Mode>\n' % (namespace_, self.gds_format_string(quote_xml(self.Open_Mode).encode(ExternalEncoding), input_name='Open_Mode'), namespace_))
16822 if self.File_Attributes is not None:
16823 showIndent(outfile, level)
16824 outfile.write('<%sFile_Attributes>%s</%sFile_Attributes>\n' % (namespace_, self.gds_format_string(quote_xml(self.File_Attributes).encode(ExternalEncoding), input_name='File_Attributes'), namespace_))
16825 - def hasContent_(self):
16826 if (
16827 self.Existing_File_Name is not None or
16828 self.Destination_File_Name is not None or
16829 self.Access_Mode is not None or
16830 self.Flags is not None or
16831 self.Open_Mode is not None or
16832 self.File_Attributes is not None
16833 ):
16834 return True
16835 else:
16836 return False
16837 - def exportLiteral(self, outfile, level, name_='File_System_Action_AttributesType'):
16845 if self.Existing_File_Name is not None:
16846 showIndent(outfile, level)
16847 outfile.write('Existing_File_Name=%s,\n' % quote_python(self.Existing_File_Name).encode(ExternalEncoding))
16848 if self.Destination_File_Name is not None:
16849 showIndent(outfile, level)
16850 outfile.write('Destination_File_Name=%s,\n' % quote_python(self.Destination_File_Name).encode(ExternalEncoding))
16851 if self.Access_Mode is not None:
16852 showIndent(outfile, level)
16853 outfile.write('Access_Mode=%s,\n' % quote_python(self.Access_Mode).encode(ExternalEncoding))
16854 if self.Flags is not None:
16855 showIndent(outfile, level)
16856 outfile.write('Flags=%s,\n' % quote_python(self.Flags).encode(ExternalEncoding))
16857 if self.Open_Mode is not None:
16858 showIndent(outfile, level)
16859 outfile.write('Open_Mode=%s,\n' % quote_python(self.Open_Mode).encode(ExternalEncoding))
16860 if self.File_Attributes is not None:
16861 showIndent(outfile, level)
16862 outfile.write('File_Attributes=%s,\n' % quote_python(self.File_Attributes).encode(ExternalEncoding))
16863 - def build(self, node):
16870 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
16871 if nodeName_ == 'Existing_File_Name':
16872 Existing_File_Name_ = child_.text
16873 Existing_File_Name_ = self.gds_validate_string(Existing_File_Name_, node, 'Existing_File_Name')
16874 self.Existing_File_Name = Existing_File_Name_
16875 elif nodeName_ == 'Destination_File_Name':
16876 Destination_File_Name_ = child_.text
16877 Destination_File_Name_ = self.gds_validate_string(Destination_File_Name_, node, 'Destination_File_Name')
16878 self.Destination_File_Name = Destination_File_Name_
16879 elif nodeName_ == 'Access_Mode':
16880 Access_Mode_ = child_.text
16881 Access_Mode_ = self.gds_validate_string(Access_Mode_, node, 'Access_Mode')
16882 self.Access_Mode = Access_Mode_
16883 elif nodeName_ == 'Flags':
16884 Flags_ = child_.text
16885 Flags_ = self.gds_validate_string(Flags_, node, 'Flags')
16886 self.Flags = Flags_
16887 elif nodeName_ == 'Open_Mode':
16888 Open_Mode_ = child_.text
16889 Open_Mode_ = self.gds_validate_string(Open_Mode_, node, 'Open_Mode')
16890 self.Open_Mode = Open_Mode_
16891 elif nodeName_ == 'File_Attributes':
16892 File_Attributes_ = child_.text
16893 File_Attributes_ = self.gds_validate_string(File_Attributes_, node, 'File_Attributes')
16894 self.File_Attributes = File_Attributes_
16895
16896
16897
16899 subclass = None
16900 superclass = None
16901 - def __init__(self, Initial_Owner=None, Thread_ID=None, Target_PID=None, Start_Address=None):
16902 self.Initial_Owner = Initial_Owner
16903 self.Thread_ID = Thread_ID
16904 self.Target_PID = Target_PID
16905 self.Start_Address = Start_Address
16911 factory = staticmethod(factory)
16915 - def set_Thread_ID(self, Thread_ID): self.Thread_ID = Thread_ID
16920 - def export(self, outfile, level, namespace_='maec:', name_='IPC_Action_AttributesType', namespacedef_=''):
16921 showIndent(outfile, level)
16922 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
16923 already_processed = []
16924 self.exportAttributes(outfile, level, already_processed, namespace_, name_='IPC_Action_AttributesType')
16925 if self.hasContent_():
16926 outfile.write('>\n')
16927 self.exportChildren(outfile, level + 1, namespace_, name_)
16928 showIndent(outfile, level)
16929 outfile.write('</%s%s>\n' % (namespace_, name_))
16930 else:
16931 outfile.write('/>\n')
16932 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='IPC_Action_AttributesType'):
16934 - def exportChildren(self, outfile, level, namespace_='maec:', name_='IPC_Action_AttributesType', fromsubclass_=False):
16935 if self.Initial_Owner is not None:
16936 showIndent(outfile, level)
16937 outfile.write('<%sInitial_Owner>%s</%sInitial_Owner>\n' % (namespace_, self.gds_format_string(quote_xml(self.Initial_Owner).encode(ExternalEncoding), input_name='Initial_Owner'), namespace_))
16938 if self.Thread_ID is not None:
16939 showIndent(outfile, level)
16940 outfile.write('<%sThread_ID>%s</%sThread_ID>\n' % (namespace_, self.gds_format_integer(self.Thread_ID, input_name='Thread_ID'), namespace_))
16941 if self.Target_PID is not None:
16942 showIndent(outfile, level)
16943 outfile.write('<%sTarget_PID>%s</%sTarget_PID>\n' % (namespace_, self.gds_format_integer(self.Target_PID, input_name='Target_PID'), namespace_))
16944 if self.Start_Address is not None:
16945 self.Start_Address.export(outfile, level, namespace_, name_='Start_Address')
16946 - def hasContent_(self):
16947 if (
16948 self.Initial_Owner is not None or
16949 self.Thread_ID is not None or
16950 self.Target_PID is not None or
16951 self.Start_Address is not None
16952 ):
16953 return True
16954 else:
16955 return False
16956 - def exportLiteral(self, outfile, level, name_='IPC_Action_AttributesType'):
16964 if self.Initial_Owner is not None:
16965 showIndent(outfile, level)
16966 outfile.write('Initial_Owner=%s,\n' % quote_python(self.Initial_Owner).encode(ExternalEncoding))
16967 if self.Thread_ID is not None:
16968 showIndent(outfile, level)
16969 outfile.write('Thread_ID=%d,\n' % self.Thread_ID)
16970 if self.Target_PID is not None:
16971 showIndent(outfile, level)
16972 outfile.write('Target_PID=%d,\n' % self.Target_PID)
16973 if self.Start_Address is not None:
16974 showIndent(outfile, level)
16975 outfile.write('Start_Address=model_.xs_hexBinary(\n')
16976 self.Start_Address.exportLiteral(outfile, level, name_='Start_Address')
16977 showIndent(outfile, level)
16978 outfile.write('),\n')
16979 - def build(self, node):
16986 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
16987 if nodeName_ == 'Initial_Owner':
16988 Initial_Owner_ = child_.text
16989 Initial_Owner_ = self.gds_validate_string(Initial_Owner_, node, 'Initial_Owner')
16990 self.Initial_Owner = Initial_Owner_
16991 elif nodeName_ == 'Thread_ID':
16992 sval_ = child_.text
16993 try:
16994 ival_ = int(sval_)
16995 except (TypeError, ValueError) as e:
16996 raise_parse_error(child_, 'requires integer: %s' % e)
16997 ival_ = self.gds_validate_integer(ival_, node, 'Thread_ID')
16998 self.Thread_ID = ival_
16999 elif nodeName_ == 'Target_PID':
17000 sval_ = child_.text
17001 try:
17002 ival_ = int(sval_)
17003 except (TypeError, ValueError) as e:
17004 raise_parse_error(child_, 'requires integer: %s' % e)
17005 ival_ = self.gds_validate_integer(ival_, node, 'Target_PID')
17006 self.Target_PID = ival_
17007 elif nodeName_ == 'Start_Address':
17008 obj_ = xs_hexBinary.factory()
17009 obj_.build(child_)
17010 self.set_Start_Address(obj_)
17011
17012
17013
17015 subclass = None
17016 superclass = None
17017 - def __init__(self, Process_Base_Address=None, Thread_ID=None, Start_Address=None, Creation_Flags=None, User_Name=None, Target_PID=None):
17018 self.Process_Base_Address = Process_Base_Address
17019 self.Thread_ID = Thread_ID
17020 self.Start_Address = Start_Address
17021 self.Creation_Flags = Creation_Flags
17022 self.User_Name = User_Name
17023 self.Target_PID = Target_PID
17029 factory = staticmethod(factory)
17033 - def set_Thread_ID(self, Thread_ID): self.Thread_ID = Thread_ID
17039 - def set_User_Name(self, User_Name): self.User_Name = User_Name
17042 - def export(self, outfile, level, namespace_='maec:', name_='Process_Action_AttributesType', namespacedef_=''):
17043 showIndent(outfile, level)
17044 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
17045 already_processed = []
17046 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Process_Action_AttributesType')
17047 if self.hasContent_():
17048 outfile.write('>\n')
17049 self.exportChildren(outfile, level + 1, namespace_, name_)
17050 showIndent(outfile, level)
17051 outfile.write('</%s%s>\n' % (namespace_, name_))
17052 else:
17053 outfile.write('/>\n')
17054 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Process_Action_AttributesType'):
17056 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Process_Action_AttributesType', fromsubclass_=False):
17057 if self.Process_Base_Address is not None:
17058 self.Process_Base_Address.export(outfile, level, namespace_, name_='Process_Base_Address')
17059 if self.Thread_ID is not None:
17060 showIndent(outfile, level)
17061 outfile.write('<%sThread_ID>%s</%sThread_ID>\n' % (namespace_, self.gds_format_string(quote_xml(self.Thread_ID).encode(ExternalEncoding), input_name='Thread_ID'), namespace_))
17062 if self.Start_Address is not None:
17063 self.Start_Address.export(outfile, level, namespace_, name_='Start_Address')
17064 if self.Creation_Flags is not None:
17065 showIndent(outfile, level)
17066 outfile.write('<%sCreation_Flags>%s</%sCreation_Flags>\n' % (namespace_, self.gds_format_string(quote_xml(self.Creation_Flags).encode(ExternalEncoding), input_name='Creation_Flags'), namespace_))
17067 if self.User_Name is not None:
17068 showIndent(outfile, level)
17069 outfile.write('<%sUser_Name>%s</%sUser_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.User_Name).encode(ExternalEncoding), input_name='User_Name'), namespace_))
17070 if self.Target_PID is not None:
17071 showIndent(outfile, level)
17072 outfile.write('<%sTarget_PID>%s</%sTarget_PID>\n' % (namespace_, self.gds_format_integer(self.Target_PID, input_name='Target_PID'), namespace_))
17073 - def hasContent_(self):
17074 if (
17075 self.Process_Base_Address is not None or
17076 self.Thread_ID is not None or
17077 self.Start_Address is not None or
17078 self.Creation_Flags is not None or
17079 self.User_Name is not None or
17080 self.Target_PID is not None
17081 ):
17082 return True
17083 else:
17084 return False
17085 - def exportLiteral(self, outfile, level, name_='Process_Action_AttributesType'):
17093 if self.Process_Base_Address is not None:
17094 showIndent(outfile, level)
17095 outfile.write('Process_Base_Address=model_.xs_hexBinary(\n')
17096 self.Process_Base_Address.exportLiteral(outfile, level, name_='Process_Base_Address')
17097 showIndent(outfile, level)
17098 outfile.write('),\n')
17099 if self.Thread_ID is not None:
17100 showIndent(outfile, level)
17101 outfile.write('Thread_ID=%s,\n' % quote_python(self.Thread_ID).encode(ExternalEncoding))
17102 if self.Start_Address is not None:
17103 showIndent(outfile, level)
17104 outfile.write('Start_Address=model_.xs_hexBinary(\n')
17105 self.Start_Address.exportLiteral(outfile, level, name_='Start_Address')
17106 showIndent(outfile, level)
17107 outfile.write('),\n')
17108 if self.Creation_Flags is not None:
17109 showIndent(outfile, level)
17110 outfile.write('Creation_Flags=%s,\n' % quote_python(self.Creation_Flags).encode(ExternalEncoding))
17111 if self.User_Name is not None:
17112 showIndent(outfile, level)
17113 outfile.write('User_Name=%s,\n' % quote_python(self.User_Name).encode(ExternalEncoding))
17114 if self.Target_PID is not None:
17115 showIndent(outfile, level)
17116 outfile.write('Target_PID=%d,\n' % self.Target_PID)
17117 - def build(self, node):
17124 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
17125 if nodeName_ == 'Process_Base_Address':
17126 obj_ = xs_hexBinary.factory()
17127 obj_.build(child_)
17128 self.set_Process_Base_Address(obj_)
17129 elif nodeName_ == 'Thread_ID':
17130 Thread_ID_ = child_.text
17131 Thread_ID_ = self.gds_validate_string(Thread_ID_, node, 'Thread_ID')
17132 self.Thread_ID = Thread_ID_
17133 elif nodeName_ == 'Start_Address':
17134 obj_ = xs_hexBinary.factory()
17135 obj_.build(child_)
17136 self.set_Start_Address(obj_)
17137 elif nodeName_ == 'Creation_Flags':
17138 Creation_Flags_ = child_.text
17139 Creation_Flags_ = self.gds_validate_string(Creation_Flags_, node, 'Creation_Flags')
17140 self.Creation_Flags = Creation_Flags_
17141 elif nodeName_ == 'User_Name':
17142 User_Name_ = child_.text
17143 User_Name_ = self.gds_validate_string(User_Name_, node, 'User_Name')
17144 self.User_Name = User_Name_
17145 elif nodeName_ == 'Target_PID':
17146 sval_ = child_.text
17147 try:
17148 ival_ = int(sval_)
17149 except (TypeError, ValueError) as e:
17150 raise_parse_error(child_, 'requires integer: %s' % e)
17151 ival_ = self.gds_validate_integer(ival_, node, 'Target_PID')
17152 self.Target_PID = ival_
17153
17154
17155
17157 subclass = None
17158 superclass = None
17159 - def __init__(self, Start_Address=None, Source_Address=None, Destination_Address=None, Page_Base_Address=None, Target_PID=None, Requested_Address=None):
17160 self.Start_Address = Start_Address
17161 self.Source_Address = Source_Address
17162 self.Destination_Address = Destination_Address
17163 self.Page_Base_Address = Page_Base_Address
17164 self.Target_PID = Target_PID
17165 self.Requested_Address = Requested_Address
17171 factory = staticmethod(factory)
17178 - def get_Page_Base_Address(self): return self.Page_Base_Address
17179 - def set_Page_Base_Address(self, Page_Base_Address): self.Page_Base_Address = Page_Base_Address
17184 - def export(self, outfile, level, namespace_='maec:', name_='Memory_Action_AttributesType', namespacedef_=''):
17185 showIndent(outfile, level)
17186 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
17187 already_processed = []
17188 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Memory_Action_AttributesType')
17189 if self.hasContent_():
17190 outfile.write('>\n')
17191 self.exportChildren(outfile, level + 1, namespace_, name_)
17192 showIndent(outfile, level)
17193 outfile.write('</%s%s>\n' % (namespace_, name_))
17194 else:
17195 outfile.write('/>\n')
17196 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Memory_Action_AttributesType'):
17198 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Memory_Action_AttributesType', fromsubclass_=False):
17199 if self.Start_Address is not None:
17200 self.Start_Address.export(outfile, level, namespace_, name_='Start_Address')
17201 if self.Source_Address is not None:
17202 self.Source_Address.export(outfile, level, namespace_, name_='Source_Address')
17203 if self.Destination_Address is not None:
17204 self.Destination_Address.export(outfile, level, namespace_, name_='Destination_Address')
17205 if self.Page_Base_Address is not None:
17206 self.Page_Base_Address.export(outfile, level, namespace_, name_='Page_Base_Address')
17207 if self.Target_PID is not None:
17208 showIndent(outfile, level)
17209 outfile.write('<%sTarget_PID>%s</%sTarget_PID>\n' % (namespace_, self.gds_format_integer(self.Target_PID, input_name='Target_PID'), namespace_))
17210 if self.Requested_Address is not None:
17211 self.Requested_Address.export(outfile, level, namespace_, name_='Requested_Address')
17212 - def hasContent_(self):
17213 if (
17214 self.Start_Address is not None or
17215 self.Source_Address is not None or
17216 self.Destination_Address is not None or
17217 self.Page_Base_Address is not None or
17218 self.Target_PID is not None or
17219 self.Requested_Address is not None
17220 ):
17221 return True
17222 else:
17223 return False
17224 - def exportLiteral(self, outfile, level, name_='Memory_Action_AttributesType'):
17232 if self.Start_Address is not None:
17233 showIndent(outfile, level)
17234 outfile.write('Start_Address=model_.xs_hexBinary(\n')
17235 self.Start_Address.exportLiteral(outfile, level, name_='Start_Address')
17236 showIndent(outfile, level)
17237 outfile.write('),\n')
17238 if self.Source_Address is not None:
17239 showIndent(outfile, level)
17240 outfile.write('Source_Address=model_.xs_hexBinary(\n')
17241 self.Source_Address.exportLiteral(outfile, level, name_='Source_Address')
17242 showIndent(outfile, level)
17243 outfile.write('),\n')
17244 if self.Destination_Address is not None:
17245 showIndent(outfile, level)
17246 outfile.write('Destination_Address=model_.xs_hexBinary(\n')
17247 self.Destination_Address.exportLiteral(outfile, level, name_='Destination_Address')
17248 showIndent(outfile, level)
17249 outfile.write('),\n')
17250 if self.Page_Base_Address is not None:
17251 showIndent(outfile, level)
17252 outfile.write('Page_Base_Address=model_.xs_hexBinary(\n')
17253 self.Page_Base_Address.exportLiteral(outfile, level, name_='Page_Base_Address')
17254 showIndent(outfile, level)
17255 outfile.write('),\n')
17256 if self.Target_PID is not None:
17257 showIndent(outfile, level)
17258 outfile.write('Target_PID=%d,\n' % self.Target_PID)
17259 if self.Requested_Address is not None:
17260 showIndent(outfile, level)
17261 outfile.write('Requested_Address=model_.xs_hexBinary(\n')
17262 self.Requested_Address.exportLiteral(outfile, level, name_='Requested_Address')
17263 showIndent(outfile, level)
17264 outfile.write('),\n')
17265 - def build(self, node):
17272 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
17273 if nodeName_ == 'Start_Address':
17274 obj_ = xs_hexBinary.factory()
17275 obj_.build(child_)
17276 self.set_Start_Address(obj_)
17277 elif nodeName_ == 'Source_Address':
17278 obj_ = xs_hexBinary.factory()
17279 obj_.build(child_)
17280 self.set_Source_Address(obj_)
17281 elif nodeName_ == 'Destination_Address':
17282 obj_ = xs_hexBinary.factory()
17283 obj_.build(child_)
17284 self.set_Destination_Address(obj_)
17285 elif nodeName_ == 'Page_Base_Address':
17286 obj_ = xs_hexBinary.factory()
17287 obj_.build(child_)
17288 self.set_Page_Base_Address(obj_)
17289 elif nodeName_ == 'Target_PID':
17290 sval_ = child_.text
17291 try:
17292 ival_ = int(sval_)
17293 except (TypeError, ValueError) as e:
17294 raise_parse_error(child_, 'requires integer: %s' % e)
17295 ival_ = self.gds_validate_integer(ival_, node, 'Target_PID')
17296 self.Target_PID = ival_
17297 elif nodeName_ == 'Requested_Address':
17298 obj_ = xs_hexBinary.factory()
17299 obj_.build(child_)
17300 self.set_Requested_Address(obj_)
17301
17302
17303
17305 subclass = None
17306 superclass = None
17307 - def __init__(self, Enumerated_Subkeys=None, Enumerated_Values=None):
17308 self.Enumerated_Subkeys = Enumerated_Subkeys
17309 self.Enumerated_Values = Enumerated_Values
17315 factory = staticmethod(factory)
17320 - def export(self, outfile, level, namespace_='maec:', name_='Registry_Action_AttributesType', namespacedef_=''):
17321 showIndent(outfile, level)
17322 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
17323 already_processed = []
17324 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Registry_Action_AttributesType')
17325 if self.hasContent_():
17326 outfile.write('>\n')
17327 self.exportChildren(outfile, level + 1, namespace_, name_)
17328 showIndent(outfile, level)
17329 outfile.write('</%s%s>\n' % (namespace_, name_))
17330 else:
17331 outfile.write('/>\n')
17332 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Registry_Action_AttributesType'):
17334 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Registry_Action_AttributesType', fromsubclass_=False):
17335 if self.Enumerated_Subkeys is not None:
17336 showIndent(outfile, level)
17337 outfile.write('<%sEnumerated_Subkeys>%s</%sEnumerated_Subkeys>\n' % (namespace_, self.gds_format_string(quote_xml(self.Enumerated_Subkeys).encode(ExternalEncoding), input_name='Enumerated_Subkeys'), namespace_))
17338 if self.Enumerated_Values is not None:
17339 showIndent(outfile, level)
17340 outfile.write('<%sEnumerated_Values>%s</%sEnumerated_Values>\n' % (namespace_, self.gds_format_string(quote_xml(self.Enumerated_Values).encode(ExternalEncoding), input_name='Enumerated_Values'), namespace_))
17341 - def hasContent_(self):
17342 if (
17343 self.Enumerated_Subkeys is not None or
17344 self.Enumerated_Values is not None
17345 ):
17346 return True
17347 else:
17348 return False
17349 - def exportLiteral(self, outfile, level, name_='Registry_Action_AttributesType'):
17357 if self.Enumerated_Subkeys is not None:
17358 showIndent(outfile, level)
17359 outfile.write('Enumerated_Subkeys=%s,\n' % quote_python(self.Enumerated_Subkeys).encode(ExternalEncoding))
17360 if self.Enumerated_Values is not None:
17361 showIndent(outfile, level)
17362 outfile.write('Enumerated_Values=%s,\n' % quote_python(self.Enumerated_Values).encode(ExternalEncoding))
17363 - def build(self, node):
17370 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
17371 if nodeName_ == 'Enumerated_Subkeys':
17372 Enumerated_Subkeys_ = child_.text
17373 Enumerated_Subkeys_ = self.gds_validate_string(Enumerated_Subkeys_, node, 'Enumerated_Subkeys')
17374 self.Enumerated_Subkeys = Enumerated_Subkeys_
17375 elif nodeName_ == 'Enumerated_Values':
17376 Enumerated_Values_ = child_.text
17377 Enumerated_Values_ = self.gds_validate_string(Enumerated_Values_, node, 'Enumerated_Values')
17378 self.Enumerated_Values = Enumerated_Values_
17379
17380
17381
17383 subclass = None
17384 superclass = None
17385 - def __init__(self, Internal_Port=None, External_Port=None, Internal_IP_Address=None, External_IP_Address=None, Host_Name=None, Data_Sent=None, Data_Received=None, Buffer_Length=None):
17386 self.Internal_Port = Internal_Port
17387 self.External_Port = External_Port
17388 self.Internal_IP_Address = Internal_IP_Address
17389 self.External_IP_Address = External_IP_Address
17390 self.Host_Name = Host_Name
17391 self.Data_Sent = Data_Sent
17392 self.Data_Received = Data_Received
17393 self.Buffer_Length = Buffer_Length
17399 factory = staticmethod(factory)
17409 - def set_Host_Name(self, Host_Name): self.Host_Name = Host_Name
17411 - def set_Data_Sent(self, Data_Sent): self.Data_Sent = Data_Sent
17416 - def export(self, outfile, level, namespace_='maec:', name_='Network_Action_AttributesType', namespacedef_=''):
17417 showIndent(outfile, level)
17418 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
17419 already_processed = []
17420 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Network_Action_AttributesType')
17421 if self.hasContent_():
17422 outfile.write('>\n')
17423 self.exportChildren(outfile, level + 1, namespace_, name_)
17424 showIndent(outfile, level)
17425 outfile.write('</%s%s>\n' % (namespace_, name_))
17426 else:
17427 outfile.write('/>\n')
17428 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Network_Action_AttributesType'):
17430 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Network_Action_AttributesType', fromsubclass_=False):
17431 if self.Internal_Port is not None:
17432 showIndent(outfile, level)
17433 outfile.write('<%sInternal_Port>%s</%sInternal_Port>\n' % (namespace_, self.gds_format_integer(self.Internal_Port, input_name='Internal_Port'), namespace_))
17434 if self.External_Port is not None:
17435 showIndent(outfile, level)
17436 outfile.write('<%sExternal_Port>%s</%sExternal_Port>\n' % (namespace_, self.gds_format_integer(self.External_Port, input_name='External_Port'), namespace_))
17437 if self.Internal_IP_Address is not None:
17438 showIndent(outfile, level)
17439 outfile.write('<%sInternal_IP_Address>%s</%sInternal_IP_Address>\n' % (namespace_, self.gds_format_string(quote_xml(self.Internal_IP_Address).encode(ExternalEncoding), input_name='Internal_IP_Address'), namespace_))
17440 if self.External_IP_Address is not None:
17441 showIndent(outfile, level)
17442 outfile.write('<%sExternal_IP_Address>%s</%sExternal_IP_Address>\n' % (namespace_, self.gds_format_string(quote_xml(self.External_IP_Address).encode(ExternalEncoding), input_name='External_IP_Address'), namespace_))
17443 if self.Host_Name is not None:
17444 showIndent(outfile, level)
17445 outfile.write('<%sHost_Name>%s</%sHost_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.Host_Name).encode(ExternalEncoding), input_name='Host_Name'), namespace_))
17446 if self.Data_Sent is not None:
17447 self.Data_Sent.export(outfile, level, namespace_, name_='Data_Sent')
17448 if self.Data_Received is not None:
17449 self.Data_Received.export(outfile, level, namespace_, name_='Data_Received')
17450 if self.Buffer_Length is not None:
17451 showIndent(outfile, level)
17452 outfile.write('<%sBuffer_Length>%s</%sBuffer_Length>\n' % (namespace_, self.gds_format_integer(self.Buffer_Length, input_name='Buffer_Length'), namespace_))
17453 - def hasContent_(self):
17454 if (
17455 self.Internal_Port is not None or
17456 self.External_Port is not None or
17457 self.Internal_IP_Address is not None or
17458 self.External_IP_Address is not None or
17459 self.Host_Name is not None or
17460 self.Data_Sent is not None or
17461 self.Data_Received is not None or
17462 self.Buffer_Length is not None
17463 ):
17464 return True
17465 else:
17466 return False
17467 - def exportLiteral(self, outfile, level, name_='Network_Action_AttributesType'):
17475 if self.Internal_Port is not None:
17476 showIndent(outfile, level)
17477 outfile.write('Internal_Port=%d,\n' % self.Internal_Port)
17478 if self.External_Port is not None:
17479 showIndent(outfile, level)
17480 outfile.write('External_Port=%d,\n' % self.External_Port)
17481 if self.Internal_IP_Address is not None:
17482 showIndent(outfile, level)
17483 outfile.write('Internal_IP_Address=%s,\n' % quote_python(self.Internal_IP_Address).encode(ExternalEncoding))
17484 if self.External_IP_Address is not None:
17485 showIndent(outfile, level)
17486 outfile.write('External_IP_Address=%s,\n' % quote_python(self.External_IP_Address).encode(ExternalEncoding))
17487 if self.Host_Name is not None:
17488 showIndent(outfile, level)
17489 outfile.write('Host_Name=%s,\n' % quote_python(self.Host_Name).encode(ExternalEncoding))
17490 if self.Data_Sent is not None:
17491 showIndent(outfile, level)
17492 outfile.write('Data_Sent=model_.DataType(\n')
17493 self.Data_Sent.exportLiteral(outfile, level, name_='Data_Sent')
17494 showIndent(outfile, level)
17495 outfile.write('),\n')
17496 if self.Data_Received is not None:
17497 showIndent(outfile, level)
17498 outfile.write('Data_Received=model_.DataType(\n')
17499 self.Data_Received.exportLiteral(outfile, level, name_='Data_Received')
17500 showIndent(outfile, level)
17501 outfile.write('),\n')
17502 if self.Buffer_Length is not None:
17503 showIndent(outfile, level)
17504 outfile.write('Buffer_Length=%d,\n' % self.Buffer_Length)
17505 - def build(self, node):
17512 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
17513 if nodeName_ == 'Internal_Port':
17514 sval_ = child_.text
17515 try:
17516 ival_ = int(sval_)
17517 except (TypeError, ValueError) as e:
17518 raise_parse_error(child_, 'requires integer: %s' % e)
17519 ival_ = self.gds_validate_integer(ival_, node, 'Internal_Port')
17520 self.Internal_Port = ival_
17521 elif nodeName_ == 'External_Port':
17522 sval_ = child_.text
17523 try:
17524 ival_ = int(sval_)
17525 except (TypeError, ValueError) as e:
17526 raise_parse_error(child_, 'requires integer: %s' % e)
17527 ival_ = self.gds_validate_integer(ival_, node, 'External_Port')
17528 self.External_Port = ival_
17529 elif nodeName_ == 'Internal_IP_Address':
17530 Internal_IP_Address_ = child_.text
17531 Internal_IP_Address_ = self.gds_validate_string(Internal_IP_Address_, node, 'Internal_IP_Address')
17532 self.Internal_IP_Address = Internal_IP_Address_
17533 elif nodeName_ == 'External_IP_Address':
17534 External_IP_Address_ = child_.text
17535 External_IP_Address_ = self.gds_validate_string(External_IP_Address_, node, 'External_IP_Address')
17536 self.External_IP_Address = External_IP_Address_
17537 elif nodeName_ == 'Host_Name':
17538 Host_Name_ = child_.text
17539 Host_Name_ = self.gds_validate_string(Host_Name_, node, 'Host_Name')
17540 self.Host_Name = Host_Name_
17541 elif nodeName_ == 'Data_Sent':
17542 obj_ = DataType.factory()
17543 obj_.build(child_)
17544 self.set_Data_Sent(obj_)
17545 elif nodeName_ == 'Data_Received':
17546 obj_ = DataType.factory()
17547 obj_.build(child_)
17548 self.set_Data_Received(obj_)
17549 elif nodeName_ == 'Buffer_Length':
17550 sval_ = child_.text
17551 try:
17552 ival_ = int(sval_)
17553 except (TypeError, ValueError) as e:
17554 raise_parse_error(child_, 'requires integer: %s' % e)
17555 ival_ = self.gds_validate_integer(ival_, node, 'Buffer_Length')
17556 self.Buffer_Length = ival_
17557
17558
17559
17561 subclass = None
17562 superclass = None
17563 - def __init__(self, Function_Name=None, Flags=None):
17564 self.Function_Name = Function_Name
17565 self.Flags = Flags
17571 factory = staticmethod(factory)
17575 - def set_Flags(self, Flags): self.Flags = Flags
17576 - def export(self, outfile, level, namespace_='maec:', name_='Module_Action_AttributesType', namespacedef_=''):
17577 showIndent(outfile, level)
17578 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
17579 already_processed = []
17580 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Module_Action_AttributesType')
17581 if self.hasContent_():
17582 outfile.write('>\n')
17583 self.exportChildren(outfile, level + 1, namespace_, name_)
17584 showIndent(outfile, level)
17585 outfile.write('</%s%s>\n' % (namespace_, name_))
17586 else:
17587 outfile.write('/>\n')
17588 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Module_Action_AttributesType'):
17590 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Module_Action_AttributesType', fromsubclass_=False):
17597 - def hasContent_(self):
17598 if (
17599 self.Function_Name is not None or
17600 self.Flags is not None
17601 ):
17602 return True
17603 else:
17604 return False
17605 - def exportLiteral(self, outfile, level, name_='Module_Action_AttributesType'):
17619 - def build(self, node):
17626 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
17627 if nodeName_ == 'Function_Name':
17628 Function_Name_ = child_.text
17629 Function_Name_ = self.gds_validate_string(Function_Name_, node, 'Function_Name')
17630 self.Function_Name = Function_Name_
17631 elif nodeName_ == 'Flags':
17632 Flags_ = child_.text
17633 Flags_ = self.gds_validate_string(Flags_, node, 'Flags')
17634 self.Flags = Flags_
17635
17636
17637
17639 subclass = None
17640 superclass = None
17641 - def __init__(self, Options=None, Start_Type=None, Desired_Access_Type=None, Enumerated_Daemons=None):
17642 self.Options = Options
17643 self.Start_Type = Start_Type
17644 self.Desired_Access_Type = Desired_Access_Type
17645 self.Enumerated_Daemons = Enumerated_Daemons
17651 factory = staticmethod(factory)
17653 - def set_Options(self, Options): self.Options = Options
17660 - def export(self, outfile, level, namespace_='maec:', name_='Daemon_Action_AttributesType', namespacedef_=''):
17661 showIndent(outfile, level)
17662 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
17663 already_processed = []
17664 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Daemon_Action_AttributesType')
17665 if self.hasContent_():
17666 outfile.write('>\n')
17667 self.exportChildren(outfile, level + 1, namespace_, name_)
17668 showIndent(outfile, level)
17669 outfile.write('</%s%s>\n' % (namespace_, name_))
17670 else:
17671 outfile.write('/>\n')
17672 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Daemon_Action_AttributesType'):
17674 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Daemon_Action_AttributesType', fromsubclass_=False):
17675 if self.Options is not None:
17676 showIndent(outfile, level)
17677 outfile.write('<%sOptions>%s</%sOptions>\n' % (namespace_, self.gds_format_string(quote_xml(self.Options).encode(ExternalEncoding), input_name='Options'), namespace_))
17678 if self.Start_Type is not None:
17679 showIndent(outfile, level)
17680 outfile.write('<%sStart_Type>%s</%sStart_Type>\n' % (namespace_, self.gds_format_string(quote_xml(self.Start_Type).encode(ExternalEncoding), input_name='Start_Type'), namespace_))
17681 if self.Desired_Access_Type is not None:
17682 showIndent(outfile, level)
17683 outfile.write('<%sDesired_Access_Type>%s</%sDesired_Access_Type>\n' % (namespace_, self.gds_format_string(quote_xml(self.Desired_Access_Type).encode(ExternalEncoding), input_name='Desired_Access_Type'), namespace_))
17684 if self.Enumerated_Daemons is not None:
17685 self.Enumerated_Daemons.export(outfile, level, namespace_, name_='Enumerated_Daemons')
17686 - def hasContent_(self):
17687 if (
17688 self.Options is not None or
17689 self.Start_Type is not None or
17690 self.Desired_Access_Type is not None or
17691 self.Enumerated_Daemons is not None
17692 ):
17693 return True
17694 else:
17695 return False
17696 - def exportLiteral(self, outfile, level, name_='Daemon_Action_AttributesType'):
17704 if self.Options is not None:
17705 showIndent(outfile, level)
17706 outfile.write('Options=%s,\n' % quote_python(self.Options).encode(ExternalEncoding))
17707 if self.Start_Type is not None:
17708 showIndent(outfile, level)
17709 outfile.write('Start_Type=%s,\n' % quote_python(self.Start_Type).encode(ExternalEncoding))
17710 if self.Desired_Access_Type is not None:
17711 showIndent(outfile, level)
17712 outfile.write('Desired_Access_Type=%s,\n' % quote_python(self.Desired_Access_Type).encode(ExternalEncoding))
17713 if self.Enumerated_Daemons is not None:
17714 showIndent(outfile, level)
17715 outfile.write('Enumerated_Daemons=model_.Enumerated_DaemonsType(\n')
17716 self.Enumerated_Daemons.exportLiteral(outfile, level, name_='Enumerated_Daemons')
17717 showIndent(outfile, level)
17718 outfile.write('),\n')
17719 - def build(self, node):
17726 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
17727 if nodeName_ == 'Options':
17728 Options_ = child_.text
17729 Options_ = self.gds_validate_string(Options_, node, 'Options')
17730 self.Options = Options_
17731 elif nodeName_ == 'Start_Type':
17732 Start_Type_ = child_.text
17733 Start_Type_ = self.gds_validate_string(Start_Type_, node, 'Start_Type')
17734 self.Start_Type = Start_Type_
17735 elif nodeName_ == 'Desired_Access_Type':
17736 Desired_Access_Type_ = child_.text
17737 Desired_Access_Type_ = self.gds_validate_string(Desired_Access_Type_, node, 'Desired_Access_Type')
17738 self.Desired_Access_Type = Desired_Access_Type_
17739 elif nodeName_ == 'Enumerated_Daemons':
17740 obj_ = Enumerated_DaemonsType.factory()
17741 obj_.build(child_)
17742 self.set_Enumerated_Daemons(obj_)
17743
17744
17745
17747 subclass = None
17748 superclass = None
17749 - def __init__(self, Daemon_Reference=None):
17750 if Daemon_Reference is None:
17751 self.Daemon_Reference = []
17752 else:
17753 self.Daemon_Reference = Daemon_Reference
17759 factory = staticmethod(factory)
17764 - def export(self, outfile, level, namespace_='maec:', name_='Enumerated_DaemonsType', namespacedef_=''):
17765 showIndent(outfile, level)
17766 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
17767 already_processed = []
17768 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Enumerated_DaemonsType')
17769 if self.hasContent_():
17770 outfile.write('>\n')
17771 self.exportChildren(outfile, level + 1, namespace_, name_)
17772 showIndent(outfile, level)
17773 outfile.write('</%s%s>\n' % (namespace_, name_))
17774 else:
17775 outfile.write('/>\n')
17776 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Enumerated_DaemonsType'):
17778 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Enumerated_DaemonsType', fromsubclass_=False):
17779 for Daemon_Reference_ in self.Daemon_Reference:
17780 Daemon_Reference_.export(outfile, level, namespace_, name_='Daemon_Reference')
17781 - def hasContent_(self):
17782 if (
17783 self.Daemon_Reference
17784 ):
17785 return True
17786 else:
17787 return False
17788 - def exportLiteral(self, outfile, level, name_='Enumerated_DaemonsType'):
17796 showIndent(outfile, level)
17797 outfile.write('Daemon_Reference=[\n')
17798 level += 1
17799 for Daemon_Reference_ in self.Daemon_Reference:
17800 showIndent(outfile, level)
17801 outfile.write('model_.ObjectReferenceType(\n')
17802 Daemon_Reference_.exportLiteral(outfile, level, name_='ObjectReferenceType')
17803 showIndent(outfile, level)
17804 outfile.write('),\n')
17805 level -= 1
17806 showIndent(outfile, level)
17807 outfile.write('],\n')
17808 - def build(self, node):
17815 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
17820
17821
17822
17824 subclass = None
17825 superclass = None
17826 - def __init__(self, Computer_Name=None, Local_Time=None):
17827 self.Computer_Name = Computer_Name
17828 self.Local_Time = Local_Time
17834 factory = staticmethod(factory)
17839 - def export(self, outfile, level, namespace_='maec:', name_='System_Action_AttributesType', namespacedef_=''):
17840 showIndent(outfile, level)
17841 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
17842 already_processed = []
17843 self.exportAttributes(outfile, level, already_processed, namespace_, name_='System_Action_AttributesType')
17844 if self.hasContent_():
17845 outfile.write('>\n')
17846 self.exportChildren(outfile, level + 1, namespace_, name_)
17847 showIndent(outfile, level)
17848 outfile.write('</%s%s>\n' % (namespace_, name_))
17849 else:
17850 outfile.write('/>\n')
17851 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='System_Action_AttributesType'):
17853 - def exportChildren(self, outfile, level, namespace_='maec:', name_='System_Action_AttributesType', fromsubclass_=False):
17854 if self.Computer_Name is not None:
17855 showIndent(outfile, level)
17856 outfile.write('<%sComputer_Name>%s</%sComputer_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.Computer_Name).encode(ExternalEncoding), input_name='Computer_Name'), namespace_))
17857 if self.Local_Time is not None:
17858 self.Local_Time.export(outfile, level, namespace_, name_='Local_Time')
17859 - def hasContent_(self):
17860 if (
17861 self.Computer_Name is not None or
17862 self.Local_Time is not None
17863 ):
17864 return True
17865 else:
17866 return False
17867 - def exportLiteral(self, outfile, level, name_='System_Action_AttributesType'):
17875 if self.Computer_Name is not None:
17876 showIndent(outfile, level)
17877 outfile.write('Computer_Name=%s,\n' % quote_python(self.Computer_Name).encode(ExternalEncoding))
17878 if self.Local_Time is not None:
17879 showIndent(outfile, level)
17880 outfile.write('Local_Time=model_.xs_time(\n')
17881 self.Local_Time.exportLiteral(outfile, level, name_='Local_Time')
17882 showIndent(outfile, level)
17883 outfile.write('),\n')
17884 - def build(self, node):
17891 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
17892 if nodeName_ == 'Computer_Name':
17893 Computer_Name_ = child_.text
17894 Computer_Name_ = self.gds_validate_string(Computer_Name_, node, 'Computer_Name')
17895 self.Computer_Name = Computer_Name_
17896 elif nodeName_ == 'Local_Time':
17897 obj_ = xs_time.factory()
17898 obj_.build(child_)
17899 self.set_Local_Time(obj_)
17900
17901
17902
17904 subclass = None
17905 superclass = None
17906 - def __init__(self, URL_Connected=None):
17907 self.URL_Connected = URL_Connected
17913 factory = staticmethod(factory)
17916 - def export(self, outfile, level, namespace_='maec:', name_='Internet_Action_AttributesType', namespacedef_=''):
17917 showIndent(outfile, level)
17918 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
17919 already_processed = []
17920 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Internet_Action_AttributesType')
17921 if self.hasContent_():
17922 outfile.write('>\n')
17923 self.exportChildren(outfile, level + 1, namespace_, name_)
17924 showIndent(outfile, level)
17925 outfile.write('</%s%s>\n' % (namespace_, name_))
17926 else:
17927 outfile.write('/>\n')
17928 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Internet_Action_AttributesType'):
17930 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Internet_Action_AttributesType', fromsubclass_=False):
17931 if self.URL_Connected is not None:
17932 self.URL_Connected.export(outfile, level, namespace_, name_='URL_Connected')
17933 - def hasContent_(self):
17934 if (
17935 self.URL_Connected is not None
17936 ):
17937 return True
17938 else:
17939 return False
17940 - def exportLiteral(self, outfile, level, name_='Internet_Action_AttributesType'):
17948 if self.URL_Connected is not None:
17949 showIndent(outfile, level)
17950 outfile.write('URL_Connected=model_.uriObject(\n')
17951 self.URL_Connected.exportLiteral(outfile, level, name_='URL_Connected')
17952 showIndent(outfile, level)
17953 outfile.write('),\n')
17954 - def build(self, node):
17961 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
17966
17967
17968
17970 """This field holds a shortform descriptor for the language that the
17971 Title field is expressed in. Attempting to install the relevant
17972 ISO 2- and 3-letter codes as the enumerated possible values is
17973 probably never going to be a realistic possibility. See RFC 3066
17974 at http://www.ietf.org/rfc/rfc3066.txt and the IANA registry at
17975 http://www.iana.org/assignments/lang-tag-apps.htm for further
17976 information. The union allows for the 'un-declaration' of
17977 xml:lang with the empty string."""
17978 subclass = None
17979 superclass = None
17980 - def __init__(self, lang=None, valueOf_=None):
17981 self.lang = _cast(None, lang)
17982 self.valueOf_ = valueOf_
17988 factory = staticmethod(factory)
17990 - def set_lang(self, lang): self.lang = lang
17992 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
17993 - def export(self, outfile, level, namespace_='maec:', name_='TitleType', namespacedef_=''):
17994 showIndent(outfile, level)
17995 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
17996 already_processed = []
17997 self.exportAttributes(outfile, level, already_processed, namespace_, name_='TitleType')
17998 if self.hasContent_():
17999 outfile.write('>')
18000 outfile.write(str(self.valueOf_).encode(ExternalEncoding))
18001 self.exportChildren(outfile, level + 1, namespace_, name_)
18002 outfile.write('</%s%s>\n' % (namespace_, name_))
18003 else:
18004 outfile.write('/>\n')
18005 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='TitleType'):
18006 if self.lang is not None and 'lang' not in already_processed:
18007 already_processed.append('lang')
18008 outfile.write(' lang=%s' % (self.gds_format_string(quote_attrib(self.lang).encode(ExternalEncoding), input_name='lang'), ))
18009 - def exportChildren(self, outfile, level, namespace_='maec:', name_='TitleType', fromsubclass_=False):
18011 - def hasContent_(self):
18012 if (
18013 self.valueOf_
18014 ):
18015 return True
18016 else:
18017 return False
18026 if self.lang is not None and 'lang' not in already_processed:
18027 already_processed.append('lang')
18028 showIndent(outfile, level)
18029 outfile.write('lang = "%s",\n' % (self.lang,))
18032 - def build(self, node):
18039 value = find_attr_value_('lang', node)
18040 if value is not None and 'lang' not in already_processed:
18041 already_processed.append('lang')
18042 self.lang = value
18043 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
18045
18046
18047
18165
18166
18167
18169 """This attribute refers to the ordinal position of the API function
18170 call parameter with respect to the function itself."""
18171 subclass = None
18172 superclass = None
18173 - def __init__(self, ordinal_position=None, Name=None, Value=None):
18174 self.ordinal_position = _cast(int, ordinal_position)
18175 self.Name = Name
18176 self.Value = Value
18182 factory = staticmethod(factory)
18184 - def set_Name(self, Name): self.Name = Name
18186 - def set_Value(self, Value): self.Value = Value
18189 - def export(self, outfile, level, namespace_='maec:', name_='APICall_ParameterType', namespacedef_=''):
18190 showIndent(outfile, level)
18191 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
18192 already_processed = []
18193 self.exportAttributes(outfile, level, already_processed, namespace_, name_='APICall_ParameterType')
18194 if self.hasContent_():
18195 outfile.write('>\n')
18196 self.exportChildren(outfile, level + 1, namespace_, name_)
18197 showIndent(outfile, level)
18198 outfile.write('</%s%s>\n' % (namespace_, name_))
18199 else:
18200 outfile.write('/>\n')
18201 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='APICall_ParameterType'):
18202 if self.ordinal_position is not None and 'ordinal_position' not in already_processed:
18203 already_processed.append('ordinal_position')
18204 outfile.write(' ordinal_position="%s"' % self.gds_format_integer(self.ordinal_position, input_name='ordinal_position'))
18205 - def exportChildren(self, outfile, level, namespace_='maec:', name_='APICall_ParameterType', fromsubclass_=False):
18212 - def hasContent_(self):
18213 if (
18214 self.Name is not None or
18215 self.Value is not None
18216 ):
18217 return True
18218 else:
18219 return False
18220 - def exportLiteral(self, outfile, level, name_='APICall_ParameterType'):
18226 if self.ordinal_position is not None and 'ordinal_position' not in already_processed:
18227 already_processed.append('ordinal_position')
18228 showIndent(outfile, level)
18229 outfile.write('ordinal_position = %d,\n' % (self.ordinal_position,))
18237 - def build(self, node):
18243 value = find_attr_value_('ordinal_position', node)
18244 if value is not None and 'ordinal_position' not in already_processed:
18245 already_processed.append('ordinal_position')
18246 try:
18247 self.ordinal_position = int(value)
18248 except ValueError as e:
18249 raise_parse_error(node, 'Bad integer attribute: %s' % e)
18250 if self.ordinal_position <= 0:
18251 raise_parse_error(node, 'Invalid PositiveInteger')
18252 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
18253 if nodeName_ == 'Name':
18254 Name_ = child_.text
18255 Name_ = self.gds_validate_string(Name_, node, 'Name')
18256 self.Name = Name_
18257 elif nodeName_ == 'Value':
18258 Value_ = child_.text
18259 Value_ = self.gds_validate_string(Value_, node, 'Value')
18260 self.Value = Value_
18261
18262
18263
18265 subclass = None
18266 superclass = None
18267 - def __init__(self, URI=None, Object_Reference=None, Object=None, Subject_Field_Data=None):
18268 self.URI = URI
18269 self.Object_Reference = Object_Reference
18270 self.Object = Object
18271 self.Subject_Field_Data = Subject_Field_Data
18277 factory = staticmethod(factory)
18278 - def get_URI(self): return self.URI
18279 - def set_URI(self, URI): self.URI = URI
18283 - def set_Object(self, Object): self.Object = Object
18286 - def export(self, outfile, level, namespace_='maec:', name_='SubjectType', namespacedef_=''):
18287 showIndent(outfile, level)
18288 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
18289 already_processed = []
18290 self.exportAttributes(outfile, level, already_processed, namespace_, name_='SubjectType')
18291 if self.hasContent_():
18292 outfile.write('>\n')
18293 self.exportChildren(outfile, level + 1, namespace_, name_)
18294 showIndent(outfile, level)
18295 outfile.write('</%s%s>\n' % (namespace_, name_))
18296 else:
18297 outfile.write('/>\n')
18298 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='SubjectType'):
18300 - def exportChildren(self, outfile, level, namespace_='maec:', name_='SubjectType', fromsubclass_=False):
18301 if self.URI is not None:
18302 self.URI.export(outfile, level, namespace_, name_='URI')
18303 if self.Object_Reference is not None:
18304 self.Object_Reference.export(outfile, level, namespace_, name_='Object_Reference')
18305 if self.Object is not None:
18306 self.Object.export(outfile, level, namespace_, name_='Object')
18307 if self.Subject_Field_Data is not None:
18308 self.Subject_Field_Data.export(outfile, level, namespace_, name_='Subject_Field_Data')
18309 - def hasContent_(self):
18310 if (
18311 self.URI is not None or
18312 self.Object_Reference is not None or
18313 self.Object is not None or
18314 self.Subject_Field_Data is not None
18315 ):
18316 return True
18317 else:
18318 return False
18327 if self.URI is not None:
18328 showIndent(outfile, level)
18329 outfile.write('URI=model_.uriObject(\n')
18330 self.URI.exportLiteral(outfile, level, name_='URI')
18331 showIndent(outfile, level)
18332 outfile.write('),\n')
18333 if self.Object_Reference is not None:
18334 showIndent(outfile, level)
18335 outfile.write('Object_Reference=model_.ObjectReferenceType(\n')
18336 self.Object_Reference.exportLiteral(outfile, level, name_='Object_Reference')
18337 showIndent(outfile, level)
18338 outfile.write('),\n')
18339 if self.Object is not None:
18340 showIndent(outfile, level)
18341 outfile.write('Object=model_.ObjectType(\n')
18342 self.Object.exportLiteral(outfile, level, name_='Object')
18343 showIndent(outfile, level)
18344 outfile.write('),\n')
18345 if self.Subject_Field_Data is not None:
18346 showIndent(outfile, level)
18347 outfile.write('Subject_Field_Data=model_.fieldDataEntry(\n')
18348 self.Subject_Field_Data.exportLiteral(outfile, level, name_='Subject_Field_Data')
18349 showIndent(outfile, level)
18350 outfile.write('),\n')
18351 - def build(self, node):
18358 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
18375
18376
18377
18379 subclass = None
18380 superclass = None
18382 if Analyst is None:
18383 self.Analyst = []
18384 else:
18385 self.Analyst = Analyst
18391 factory = staticmethod(factory)
18393 - def set_Analyst(self, Analyst): self.Analyst = Analyst
18394 - def add_Analyst(self, value): self.Analyst.append(value)
18395 - def insert_Analyst(self, index, value): self.Analyst[index] = value
18396 - def export(self, outfile, level, namespace_='maec:', name_='AnalystsType', namespacedef_=''):
18397 showIndent(outfile, level)
18398 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
18399 already_processed = []
18400 self.exportAttributes(outfile, level, already_processed, namespace_, name_='AnalystsType')
18401 if self.hasContent_():
18402 outfile.write('>\n')
18403 self.exportChildren(outfile, level + 1, namespace_, name_)
18404 showIndent(outfile, level)
18405 outfile.write('</%s%s>\n' % (namespace_, name_))
18406 else:
18407 outfile.write('/>\n')
18408 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='AnalystsType'):
18410 - def exportChildren(self, outfile, level, namespace_='maec:', name_='AnalystsType', fromsubclass_=False):
18414 - def hasContent_(self):
18415 if (
18416 self.Analyst
18417 ):
18418 return True
18419 else:
18420 return False
18421 - def exportLiteral(self, outfile, level, name_='AnalystsType'):
18429 showIndent(outfile, level)
18430 outfile.write('Analyst=[\n')
18431 level += 1
18432 for Analyst_ in self.Analyst:
18433 showIndent(outfile, level)
18434 outfile.write('%s,\n' % quote_python(Analyst_).encode(ExternalEncoding))
18435 level -= 1
18436 showIndent(outfile, level)
18437 outfile.write('],\n')
18438 - def build(self, node):
18445 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
18446 if nodeName_ == 'Analyst':
18447 Analyst_ = child_.text
18448 Analyst_ = self.gds_validate_string(Analyst_, node, 'Analyst')
18449 self.Analyst.append(Analyst_)
18450
18451
18452
18454 subclass = None
18455 superclass = None
18456 - def __init__(self, Organization_Name=None, POC=None, URI=None):
18457 self.Organization_Name = Organization_Name
18458 self.POC = POC
18459 self.URI = URI
18465 factory = staticmethod(factory)
18468 - def get_POC(self): return self.POC
18469 - def set_POC(self, POC): self.POC = POC
18470 - def get_URI(self): return self.URI
18471 - def set_URI(self, URI): self.URI = URI
18472 - def export(self, outfile, level, namespace_='maec:', name_='SourceType', namespacedef_=''):
18473 showIndent(outfile, level)
18474 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
18475 already_processed = []
18476 self.exportAttributes(outfile, level, already_processed, namespace_, name_='SourceType')
18477 if self.hasContent_():
18478 outfile.write('>\n')
18479 self.exportChildren(outfile, level + 1, namespace_, name_)
18480 showIndent(outfile, level)
18481 outfile.write('</%s%s>\n' % (namespace_, name_))
18482 else:
18483 outfile.write('/>\n')
18484 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='SourceType'):
18486 - def exportChildren(self, outfile, level, namespace_='maec:', name_='SourceType', fromsubclass_=False):
18487 if self.Organization_Name is not None:
18488 showIndent(outfile, level)
18489 outfile.write('<%sOrganization_Name>%s</%sOrganization_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.Organization_Name).encode(ExternalEncoding), input_name='Organization_Name'), namespace_))
18490 if self.POC is not None:
18491 showIndent(outfile, level)
18492 outfile.write('<%sPOC>%s</%sPOC>\n' % (namespace_, self.gds_format_string(quote_xml(self.POC).encode(ExternalEncoding), input_name='POC'), namespace_))
18493 if self.URI is not None:
18494 self.URI.export(outfile, level, namespace_, name_='URI')
18495 - def hasContent_(self):
18496 if (
18497 self.Organization_Name is not None or
18498 self.POC is not None or
18499 self.URI is not None
18500 ):
18501 return True
18502 else:
18503 return False
18512 if self.Organization_Name is not None:
18513 showIndent(outfile, level)
18514 outfile.write('Organization_Name=%s,\n' % quote_python(self.Organization_Name).encode(ExternalEncoding))
18515 if self.POC is not None:
18516 showIndent(outfile, level)
18517 outfile.write('POC=%s,\n' % quote_python(self.POC).encode(ExternalEncoding))
18518 if self.URI is not None:
18519 showIndent(outfile, level)
18520 outfile.write('URI=model_.uriObject(\n')
18521 self.URI.exportLiteral(outfile, level, name_='URI')
18522 showIndent(outfile, level)
18523 outfile.write('),\n')
18524 - def build(self, node):
18531 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
18532 if nodeName_ == 'Organization_Name':
18533 Organization_Name_ = child_.text
18534 Organization_Name_ = self.gds_validate_string(Organization_Name_, node, 'Organization_Name')
18535 self.Organization_Name = Organization_Name_
18536 elif nodeName_ == 'POC':
18537 POC_ = child_.text
18538 POC_ = self.gds_validate_string(POC_, node, 'POC')
18539 self.POC = POC_
18540 elif nodeName_ == 'URI':
18541 obj_ = uriObject.factory()
18542 obj_.build(child_)
18543 self.set_URI(obj_)
18544
18545
18546
18548 subclass = None
18549 superclass = None
18550 - def __init__(self, OS=None, Enivironment_Variables=None):
18551 self.OS = OS
18552 self.Enivironment_Variables = Enivironment_Variables
18558 factory = staticmethod(factory)
18559 - def get_OS(self): return self.OS
18560 - def set_OS(self, OS): self.OS = OS
18563 - def export(self, outfile, level, namespace_='maec:', name_='Analysis_EnvironmentType', namespacedef_=''):
18564 showIndent(outfile, level)
18565 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
18566 already_processed = []
18567 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Analysis_EnvironmentType')
18568 if self.hasContent_():
18569 outfile.write('>\n')
18570 self.exportChildren(outfile, level + 1, namespace_, name_)
18571 showIndent(outfile, level)
18572 outfile.write('</%s%s>\n' % (namespace_, name_))
18573 else:
18574 outfile.write('/>\n')
18575 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Analysis_EnvironmentType'):
18577 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Analysis_EnvironmentType', fromsubclass_=False):
18578 if self.OS is not None:
18579 self.OS.export(outfile, level, namespace_, name_='OS')
18580 if self.Enivironment_Variables is not None:
18581 self.Enivironment_Variables.export(outfile, level, namespace_, name_='Enivironment_Variables')
18582 - def hasContent_(self):
18583 if (
18584 self.OS is not None or
18585 self.Enivironment_Variables is not None
18586 ):
18587 return True
18588 else:
18589 return False
18590 - def exportLiteral(self, outfile, level, name_='Analysis_EnvironmentType'):
18598 if self.OS is not None:
18599 showIndent(outfile, level)
18600 outfile.write('OS=model_.CPESpecificationType(\n')
18601 self.OS.exportLiteral(outfile, level, name_='OS')
18602 showIndent(outfile, level)
18603 outfile.write('),\n')
18604 if self.Enivironment_Variables is not None:
18605 showIndent(outfile, level)
18606 outfile.write('Enivironment_Variables=model_.Enivironment_VariablesType(\n')
18607 self.Enivironment_Variables.exportLiteral(outfile, level, name_='Enivironment_Variables')
18608 showIndent(outfile, level)
18609 outfile.write('),\n')
18610 - def build(self, node):
18617 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
18626
18627
18628
18630 subclass = None
18631 superclass = None
18632 - def __init__(self, Environment_Variable=None):
18633 if Environment_Variable is None:
18634 self.Environment_Variable = []
18635 else:
18636 self.Environment_Variable = Environment_Variable
18642 factory = staticmethod(factory)
18647 - def export(self, outfile, level, namespace_='maec:', name_='Enivironment_VariablesType', namespacedef_=''):
18648 showIndent(outfile, level)
18649 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
18650 already_processed = []
18651 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Enivironment_VariablesType')
18652 if self.hasContent_():
18653 outfile.write('>\n')
18654 self.exportChildren(outfile, level + 1, namespace_, name_)
18655 showIndent(outfile, level)
18656 outfile.write('</%s%s>\n' % (namespace_, name_))
18657 else:
18658 outfile.write('/>\n')
18659 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Enivironment_VariablesType'):
18661 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Enivironment_VariablesType', fromsubclass_=False):
18662 for Environment_Variable_ in self.Environment_Variable:
18663 Environment_Variable_.export(outfile, level, namespace_, name_='Environment_Variable')
18664 - def hasContent_(self):
18665 if (
18666 self.Environment_Variable
18667 ):
18668 return True
18669 else:
18670 return False
18671 - def exportLiteral(self, outfile, level, name_='Enivironment_VariablesType'):
18679 showIndent(outfile, level)
18680 outfile.write('Environment_Variable=[\n')
18681 level += 1
18682 for Environment_Variable_ in self.Environment_Variable:
18683 showIndent(outfile, level)
18684 outfile.write('model_.Environment_VariableType(\n')
18685 Environment_Variable_.exportLiteral(outfile, level, name_='Environment_VariableType')
18686 showIndent(outfile, level)
18687 outfile.write('),\n')
18688 level -= 1
18689 showIndent(outfile, level)
18690 outfile.write('],\n')
18691 - def build(self, node):
18698 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
18703
18704
18705
18707 subclass = None
18708 superclass = None
18709 - def __init__(self, Name=None, Value=None):
18710 self.Name = Name
18711 self.Value = Value
18717 factory = staticmethod(factory)
18719 - def set_Name(self, Name): self.Name = Name
18721 - def set_Value(self, Value): self.Value = Value
18722 - def export(self, outfile, level, namespace_='maec:', name_='Environment_VariableType', namespacedef_=''):
18723 showIndent(outfile, level)
18724 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
18725 already_processed = []
18726 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Environment_VariableType')
18727 if self.hasContent_():
18728 outfile.write('>\n')
18729 self.exportChildren(outfile, level + 1, namespace_, name_)
18730 showIndent(outfile, level)
18731 outfile.write('</%s%s>\n' % (namespace_, name_))
18732 else:
18733 outfile.write('/>\n')
18734 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Environment_VariableType'):
18736 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Environment_VariableType', fromsubclass_=False):
18743 - def hasContent_(self):
18744 if (
18745 self.Name is not None or
18746 self.Value is not None
18747 ):
18748 return True
18749 else:
18750 return False
18751 - def exportLiteral(self, outfile, level, name_='Environment_VariableType'):
18765 - def build(self, node):
18772 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
18773 if nodeName_ == 'Name':
18774 Name_ = child_.text
18775 Name_ = self.gds_validate_string(Name_, node, 'Name')
18776 self.Name = Name_
18777 elif nodeName_ == 'Value':
18778 Value_ = child_.text
18779 Value_ = self.gds_validate_string(Value_, node, 'Value')
18780 self.Value = Value_
18781
18782
18783
18858
18859
18860
18862 subclass = None
18863 superclass = None
18865 if Note is None:
18866 self.Note = []
18867 else:
18868 self.Note = Note
18874 factory = staticmethod(factory)
18876 - def set_Note(self, Note): self.Note = Note
18877 - def add_Note(self, value): self.Note.append(value)
18878 - def insert_Note(self, index, value): self.Note[index] = value
18879 - def export(self, outfile, level, namespace_='maec:', name_='NotesType', namespacedef_=''):
18880 showIndent(outfile, level)
18881 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
18882 already_processed = []
18883 self.exportAttributes(outfile, level, already_processed, namespace_, name_='NotesType')
18884 if self.hasContent_():
18885 outfile.write('>\n')
18886 self.exportChildren(outfile, level + 1, namespace_, name_)
18887 showIndent(outfile, level)
18888 outfile.write('</%s%s>\n' % (namespace_, name_))
18889 else:
18890 outfile.write('/>\n')
18891 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='NotesType'):
18893 - def exportChildren(self, outfile, level, namespace_='maec:', name_='NotesType', fromsubclass_=False):
18897 - def hasContent_(self):
18898 if (
18899 self.Note
18900 ):
18901 return True
18902 else:
18903 return False
18912 showIndent(outfile, level)
18913 outfile.write('Note=[\n')
18914 level += 1
18915 for Note_ in self.Note:
18916 showIndent(outfile, level)
18917 outfile.write('%s,\n' % quote_python(Note_).encode(ExternalEncoding))
18918 level -= 1
18919 showIndent(outfile, level)
18920 outfile.write('],\n')
18921 - def build(self, node):
18928 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
18929 if nodeName_ == 'Note':
18930 Note_ = child_.text
18931 Note_ = self.gds_validate_string(Note_, node, 'Note')
18932 self.Note.append(Note_)
18933
18934
18935
18937 """This attribute represents the Units used in the object size field.
18938 Possible values are: Bytes, Kilobytes, Megabytes."""
18939 subclass = None
18940 superclass = None
18941 - def __init__(self, units=None, valueOf_=None):
18942 self.units = _cast(None, units)
18943 self.valueOf_ = valueOf_
18949 factory = staticmethod(factory)
18951 - def set_units(self, units): self.units = units
18953 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
18954 - def export(self, outfile, level, namespace_='maec:', name_='Data_SizeType', namespacedef_=''):
18955 showIndent(outfile, level)
18956 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
18957 already_processed = []
18958 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Data_SizeType')
18959 if self.hasContent_():
18960 outfile.write('>')
18961 outfile.write(str(self.valueOf_).encode(ExternalEncoding))
18962 self.exportChildren(outfile, level + 1, namespace_, name_)
18963 outfile.write('</%s%s>\n' % (namespace_, name_))
18964 else:
18965 outfile.write('/>\n')
18966 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Data_SizeType'):
18967 if self.units is not None and 'units' not in already_processed:
18968 already_processed.append('units')
18969 outfile.write(' units=%s' % (self.gds_format_string(quote_attrib(self.units).encode(ExternalEncoding), input_name='units'), ))
18970 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Data_SizeType', fromsubclass_=False):
18972 - def hasContent_(self):
18973 if (
18974 self.valueOf_
18975 ):
18976 return True
18977 else:
18978 return False
18979 - def exportLiteral(self, outfile, level, name_='Data_SizeType'):
18987 if self.units is not None and 'units' not in already_processed:
18988 already_processed.append('units')
18989 showIndent(outfile, level)
18990 outfile.write('units = "%s",\n' % (self.units,))
18993 - def build(self, node):
19000 value = find_attr_value_('units', node)
19001 if value is not None and 'units' not in already_processed:
19002 already_processed.append('units')
19003 self.units = value
19004 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
19006
19007
19008
19010 subclass = None
19011 superclass = None
19013 if Hash is None:
19014 self.Hash = []
19015 else:
19016 self.Hash = Hash
19022 factory = staticmethod(factory)
19024 - def set_Hash(self, Hash): self.Hash = Hash
19025 - def add_Hash(self, value): self.Hash.append(value)
19026 - def insert_Hash(self, index, value): self.Hash[index] = value
19027 - def export(self, outfile, level, namespace_='maec:', name_='HashesType5', namespacedef_=''):
19028 showIndent(outfile, level)
19029 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
19030 already_processed = []
19031 self.exportAttributes(outfile, level, already_processed, namespace_, name_='HashesType5')
19032 if self.hasContent_():
19033 outfile.write('>\n')
19034 self.exportChildren(outfile, level + 1, namespace_, name_)
19035 showIndent(outfile, level)
19036 outfile.write('</%s%s>\n' % (namespace_, name_))
19037 else:
19038 outfile.write('/>\n')
19039 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='HashesType5'):
19041 - def exportChildren(self, outfile, level, namespace_='maec:', name_='HashesType5', fromsubclass_=False):
19042 for Hash_ in self.Hash:
19043 Hash_.export(outfile, level, namespace_, name_='Hash')
19044 - def hasContent_(self):
19045 if (
19046 self.Hash
19047 ):
19048 return True
19049 else:
19050 return False
19059 showIndent(outfile, level)
19060 outfile.write('Hash=[\n')
19061 level += 1
19062 for Hash_ in self.Hash:
19063 showIndent(outfile, level)
19064 outfile.write('model_.HashType(\n')
19065 Hash_.exportLiteral(outfile, level, name_='HashType')
19066 showIndent(outfile, level)
19067 outfile.write('),\n')
19068 level -= 1
19069 showIndent(outfile, level)
19070 outfile.write('],\n')
19071 - def build(self, node):
19078 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
19079 if nodeName_ == 'Hash':
19080 obj_ = HashType.factory()
19081 obj_.build(child_)
19082 self.Hash.append(obj_)
19083
19084
19085
19087 subclass = None
19088 superclass = None
19090 if Hash is None:
19091 self.Hash = []
19092 else:
19093 self.Hash = Hash
19099 factory = staticmethod(factory)
19101 - def set_Hash(self, Hash): self.Hash = Hash
19102 - def add_Hash(self, value): self.Hash.append(value)
19103 - def insert_Hash(self, index, value): self.Hash[index] = value
19104 - def export(self, outfile, level, namespace_='maec:', name_='HashesType6', namespacedef_=''):
19105 showIndent(outfile, level)
19106 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
19107 already_processed = []
19108 self.exportAttributes(outfile, level, already_processed, namespace_, name_='HashesType6')
19109 if self.hasContent_():
19110 outfile.write('>\n')
19111 self.exportChildren(outfile, level + 1, namespace_, name_)
19112 showIndent(outfile, level)
19113 outfile.write('</%s%s>\n' % (namespace_, name_))
19114 else:
19115 outfile.write('/>\n')
19116 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='HashesType6'):
19118 - def exportChildren(self, outfile, level, namespace_='maec:', name_='HashesType6', fromsubclass_=False):
19119 for Hash_ in self.Hash:
19120 Hash_.export(outfile, level, namespace_, name_='Hash')
19121 - def hasContent_(self):
19122 if (
19123 self.Hash
19124 ):
19125 return True
19126 else:
19127 return False
19136 showIndent(outfile, level)
19137 outfile.write('Hash=[\n')
19138 level += 1
19139 for Hash_ in self.Hash:
19140 showIndent(outfile, level)
19141 outfile.write('model_.HashType(\n')
19142 Hash_.exportLiteral(outfile, level, name_='HashType')
19143 showIndent(outfile, level)
19144 outfile.write('),\n')
19145 level -= 1
19146 showIndent(outfile, level)
19147 outfile.write('],\n')
19148 - def build(self, node):
19155 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
19156 if nodeName_ == 'Hash':
19157 obj_ = HashType.factory()
19158 obj_.build(child_)
19159 self.Hash.append(obj_)
19160
19161
19162
19164 subclass = None
19165 superclass = None
19166 - def __init__(self, Imported_Function=None):
19167 if Imported_Function is None:
19168 self.Imported_Function = []
19169 else:
19170 self.Imported_Function = Imported_Function
19176 factory = staticmethod(factory)
19181 - def export(self, outfile, level, namespace_='maec:', name_='Imported_FunctionsType', namespacedef_=''):
19182 showIndent(outfile, level)
19183 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
19184 already_processed = []
19185 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Imported_FunctionsType')
19186 if self.hasContent_():
19187 outfile.write('>\n')
19188 self.exportChildren(outfile, level + 1, namespace_, name_)
19189 showIndent(outfile, level)
19190 outfile.write('</%s%s>\n' % (namespace_, name_))
19191 else:
19192 outfile.write('/>\n')
19193 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Imported_FunctionsType'):
19195 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Imported_FunctionsType', fromsubclass_=False):
19196 for Imported_Function_ in self.Imported_Function:
19197 Imported_Function_.export(outfile, level, namespace_, name_='Imported_Function')
19198 - def hasContent_(self):
19199 if (
19200 self.Imported_Function
19201 ):
19202 return True
19203 else:
19204 return False
19205 - def exportLiteral(self, outfile, level, name_='Imported_FunctionsType'):
19213 showIndent(outfile, level)
19214 outfile.write('Imported_Function=[\n')
19215 level += 1
19216 for Imported_Function_ in self.Imported_Function:
19217 showIndent(outfile, level)
19218 outfile.write('model_.Imported_FunctionType(\n')
19219 Imported_Function_.exportLiteral(outfile, level, name_='Imported_FunctionType')
19220 showIndent(outfile, level)
19221 outfile.write('),\n')
19222 level -= 1
19223 showIndent(outfile, level)
19224 outfile.write('],\n')
19225 - def build(self, node):
19232 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
19237
19238
19239
19241 subclass = None
19242 superclass = None
19243 - def __init__(self, Function_Name=None, Virtual_Address=None, Hint=None, Ordinal=None):
19244 self.Function_Name = Function_Name
19245 self.Virtual_Address = Virtual_Address
19246 self.Hint = Hint
19247 self.Ordinal = Ordinal
19253 factory = staticmethod(factory)
19259 - def set_Hint(self, Hint): self.Hint = Hint
19261 - def set_Ordinal(self, Ordinal): self.Ordinal = Ordinal
19262 - def export(self, outfile, level, namespace_='maec:', name_='Imported_FunctionType', namespacedef_=''):
19263 showIndent(outfile, level)
19264 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
19265 already_processed = []
19266 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Imported_FunctionType')
19267 if self.hasContent_():
19268 outfile.write('>\n')
19269 self.exportChildren(outfile, level + 1, namespace_, name_)
19270 showIndent(outfile, level)
19271 outfile.write('</%s%s>\n' % (namespace_, name_))
19272 else:
19273 outfile.write('/>\n')
19274 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Imported_FunctionType'):
19276 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Imported_FunctionType', fromsubclass_=False):
19277 if self.Function_Name is not None:
19278 showIndent(outfile, level)
19279 outfile.write('<%sFunction_Name>%s</%sFunction_Name>\n' % (namespace_, self.gds_format_string(quote_xml(self.Function_Name).encode(ExternalEncoding), input_name='Function_Name'), namespace_))
19280 if self.Virtual_Address is not None:
19281 showIndent(outfile, level)
19282 outfile.write('<%sVirtual_Address>%s</%sVirtual_Address>\n' % (namespace_, self.gds_format_string(quote_xml(self.Virtual_Address).encode(ExternalEncoding), input_name='Virtual_Address'), namespace_))
19283 if self.Hint is not None:
19284 self.Hint.export(outfile, level, namespace_, name_='Hint')
19285 if self.Ordinal is not None:
19286 showIndent(outfile, level)
19287 outfile.write('<%sOrdinal>%s</%sOrdinal>\n' % (namespace_, self.gds_format_integer(self.Ordinal, input_name='Ordinal'), namespace_))
19288 - def hasContent_(self):
19289 if (
19290 self.Function_Name is not None or
19291 self.Virtual_Address is not None or
19292 self.Hint is not None or
19293 self.Ordinal is not None
19294 ):
19295 return True
19296 else:
19297 return False
19298 - def exportLiteral(self, outfile, level, name_='Imported_FunctionType'):
19306 if self.Function_Name is not None:
19307 showIndent(outfile, level)
19308 outfile.write('Function_Name=%s,\n' % quote_python(self.Function_Name).encode(ExternalEncoding))
19309 if self.Virtual_Address is not None:
19310 showIndent(outfile, level)
19311 outfile.write('Virtual_Address=model_.xs_hexBinary(\n')
19312 self.Virtual_Address.exportLiteral(outfile, level, name_='Virtual_Address')
19313 showIndent(outfile, level)
19314 outfile.write('),\n')
19315 if self.Hint is not None:
19316 showIndent(outfile, level)
19317 outfile.write('Hint=model_.xs_hexBinary(\n')
19318 self.Hint.exportLiteral(outfile, level, name_='Hint')
19319 showIndent(outfile, level)
19320 outfile.write('),\n')
19321 if self.Ordinal is not None:
19322 showIndent(outfile, level)
19323 outfile.write('Ordinal=%d,\n' % self.Ordinal)
19324 - def build(self, node):
19331 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
19332 if nodeName_ == 'Function_Name':
19333 Function_Name_ = child_.text
19334 Function_Name_ = self.gds_validate_string(Function_Name_, node, 'Function_Name')
19335 self.Function_Name = Function_Name_
19336 elif nodeName_ == 'Virtual_Address':
19337 obj_ = xs_hexBinary.factory()
19338 obj_.build(child_)
19339 self.set_Virtual_Address(obj_)
19340 elif nodeName_ == 'Hint':
19341 obj_ = xs_hexBinary.factory()
19342 obj_.build(child_)
19343 self.set_Hint(obj_)
19344 elif nodeName_ == 'Ordinal':
19345 sval_ = child_.text
19346 try:
19347 ival_ = int(sval_)
19348 except (TypeError, ValueError) as e:
19349 raise_parse_error(child_, 'requires integer: %s' % e)
19350 ival_ = self.gds_validate_integer(ival_, node, 'Ordinal')
19351 self.Ordinal = ival_
19352
19353
19354
19356 subclass = None
19357 superclass = None
19359 if Hash is None:
19360 self.Hash = []
19361 else:
19362 self.Hash = Hash
19368 factory = staticmethod(factory)
19374 showIndent(outfile, level)
19375 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
19376 already_processed = []
19377 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Header_HashesType')
19378 if self.hasContent_():
19379 outfile.write('>\n')
19380 self.exportChildren(outfile, level + 1, namespace_, name_)
19381 showIndent(outfile, level)
19382 outfile.write('</%s%s>\n' % (namespace_, name_))
19383 else:
19384 outfile.write('/>\n')
19388 for Hash_ in self.Hash:
19389 Hash_.export(outfile, level, namespace_, name_='Hash')
19391 if (
19392 self.Hash
19393 ):
19394 return True
19395 else:
19396 return False
19405 showIndent(outfile, level)
19406 outfile.write('Hash=[\n')
19407 level += 1
19408 for Hash_ in self.Hash:
19409 showIndent(outfile, level)
19410 outfile.write('model_.HashType(\n')
19411 Hash_.exportLiteral(outfile, level, name_='HashType')
19412 showIndent(outfile, level)
19413 outfile.write('),\n')
19414 level -= 1
19415 showIndent(outfile, level)
19416 outfile.write('],\n')
19425 if nodeName_ == 'Hash':
19426 obj_ = HashType.factory()
19427 obj_.build(child_)
19428 self.Hash.append(obj_)
19429
19430
19431
19433 subclass = None
19434 superclass = None
19436 if Hash is None:
19437 self.Hash = []
19438 else:
19439 self.Hash = Hash
19445 factory = staticmethod(factory)
19447 - def set_Hash(self, Hash): self.Hash = Hash
19448 - def add_Hash(self, value): self.Hash.append(value)
19449 - def insert_Hash(self, index, value): self.Hash[index] = value
19450 - def export(self, outfile, level, namespace_='maec:', name_='Data_HashesType', namespacedef_=''):
19451 showIndent(outfile, level)
19452 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
19453 already_processed = []
19454 self.exportAttributes(outfile, level, already_processed, namespace_, name_='Data_HashesType')
19455 if self.hasContent_():
19456 outfile.write('>\n')
19457 self.exportChildren(outfile, level + 1, namespace_, name_)
19458 showIndent(outfile, level)
19459 outfile.write('</%s%s>\n' % (namespace_, name_))
19460 else:
19461 outfile.write('/>\n')
19462 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='Data_HashesType'):
19464 - def exportChildren(self, outfile, level, namespace_='maec:', name_='Data_HashesType', fromsubclass_=False):
19465 for Hash_ in self.Hash:
19466 Hash_.export(outfile, level, namespace_, name_='Hash')
19467 - def hasContent_(self):
19468 if (
19469 self.Hash
19470 ):
19471 return True
19472 else:
19473 return False
19474 - def exportLiteral(self, outfile, level, name_='Data_HashesType'):
19482 showIndent(outfile, level)
19483 outfile.write('Hash=[\n')
19484 level += 1
19485 for Hash_ in self.Hash:
19486 showIndent(outfile, level)
19487 outfile.write('model_.HashType(\n')
19488 Hash_.exportLiteral(outfile, level, name_='HashType')
19489 showIndent(outfile, level)
19490 outfile.write('),\n')
19491 level -= 1
19492 showIndent(outfile, level)
19493 outfile.write('],\n')
19494 - def build(self, node):
19501 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
19502 if nodeName_ == 'Hash':
19503 obj_ = HashType.factory()
19504 obj_.build(child_)
19505 self.Hash.append(obj_)
19506
19507
19508
19510 subclass = None
19511 superclass = None
19513 if Hash is None:
19514 self.Hash = []
19515 else:
19516 self.Hash = Hash
19522 factory = staticmethod(factory)
19524 - def set_Hash(self, Hash): self.Hash = Hash
19525 - def add_Hash(self, value): self.Hash.append(value)
19526 - def insert_Hash(self, index, value): self.Hash[index] = value
19527 - def export(self, outfile, level, namespace_='maec:', name_='HashesType7', namespacedef_=''):
19528 showIndent(outfile, level)
19529 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
19530 already_processed = []
19531 self.exportAttributes(outfile, level, already_processed, namespace_, name_='HashesType7')
19532 if self.hasContent_():
19533 outfile.write('>\n')
19534 self.exportChildren(outfile, level + 1, namespace_, name_)
19535 showIndent(outfile, level)
19536 outfile.write('</%s%s>\n' % (namespace_, name_))
19537 else:
19538 outfile.write('/>\n')
19539 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='HashesType7'):
19541 - def exportChildren(self, outfile, level, namespace_='maec:', name_='HashesType7', fromsubclass_=False):
19542 for Hash_ in self.Hash:
19543 Hash_.export(outfile, level, namespace_, name_='Hash')
19544 - def hasContent_(self):
19545 if (
19546 self.Hash
19547 ):
19548 return True
19549 else:
19550 return False
19559 showIndent(outfile, level)
19560 outfile.write('Hash=[\n')
19561 level += 1
19562 for Hash_ in self.Hash:
19563 showIndent(outfile, level)
19564 outfile.write('model_.HashType(\n')
19565 Hash_.exportLiteral(outfile, level, name_='HashType')
19566 showIndent(outfile, level)
19567 outfile.write('),\n')
19568 level -= 1
19569 showIndent(outfile, level)
19570 outfile.write('],\n')
19571 - def build(self, node):
19578 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
19579 if nodeName_ == 'Hash':
19580 obj_ = HashType.factory()
19581 obj_.build(child_)
19582 self.Hash.append(obj_)
19583
19584
19585
19587 subclass = None
19588 superclass = None
19589 - def __init__(self, file=None, uri=None, domain=None, registry=None, ip=None, asn=None, entity=None, classification=None):
19590 if file is None:
19591 self.file = []
19592 else:
19593 self.file = file
19594 if uri is None:
19595 self.uri = []
19596 else:
19597 self.uri = uri
19598 if domain is None:
19599 self.domain = []
19600 else:
19601 self.domain = domain
19602 if registry is None:
19603 self.registry = []
19604 else:
19605 self.registry = registry
19606 if ip is None:
19607 self.ip = []
19608 else:
19609 self.ip = ip
19610 if asn is None:
19611 self.asn = []
19612 else:
19613 self.asn = asn
19614 if entity is None:
19615 self.entity = []
19616 else:
19617 self.entity = entity
19618 if classification is None:
19619 self.classification = []
19620 else:
19621 self.classification = classification
19627 factory = staticmethod(factory)
19629 - def set_file(self, file): self.file = file
19630 - def add_file(self, value): self.file.append(value)
19631 - def insert_file(self, index, value): self.file[index] = value
19632 - def get_uri(self): return self.uri
19633 - def set_uri(self, uri): self.uri = uri
19634 - def add_uri(self, value): self.uri.append(value)
19635 - def insert_uri(self, index, value): self.uri[index] = value
19636 - def get_domain(self): return self.domain
19637 - def set_domain(self, domain): self.domain = domain
19638 - def add_domain(self, value): self.domain.append(value)
19639 - def insert_domain(self, index, value): self.domain[index] = value
19641 - def set_registry(self, registry): self.registry = registry
19642 - def add_registry(self, value): self.registry.append(value)
19646 - def add_ip(self, value): self.ip.append(value)
19647 - def insert_ip(self, index, value): self.ip[index] = value
19648 - def get_asn(self): return self.asn
19649 - def set_asn(self, asn): self.asn = asn
19650 - def add_asn(self, value): self.asn.append(value)
19651 - def insert_asn(self, index, value): self.asn[index] = value
19653 - def set_entity(self, entity): self.entity = entity
19654 - def add_entity(self, value): self.entity.append(value)
19655 - def insert_entity(self, index, value): self.entity[index] = value
19660 - def export(self, outfile, level, namespace_='maec:', name_='objectsType', namespacedef_=''):
19661 showIndent(outfile, level)
19662 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
19663 already_processed = []
19664 self.exportAttributes(outfile, level, already_processed, namespace_, name_='objectsType')
19665 if self.hasContent_():
19666 outfile.write('>\n')
19667 self.exportChildren(outfile, level + 1, namespace_, name_)
19668 showIndent(outfile, level)
19669 outfile.write('</%s%s>\n' % (namespace_, name_))
19670 else:
19671 outfile.write('/>\n')
19672 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='objectsType'):
19674 - def exportChildren(self, outfile, level, namespace_='maec:', name_='objectsType', fromsubclass_=False):
19675 for file_ in self.file:
19676 file_.export(outfile, level, namespace_, name_='file')
19677 for uri_ in self.uri:
19678 uri_.export(outfile, level, namespace_, name_='uri')
19679 for domain_ in self.domain:
19680 domain_.export(outfile, level, namespace_, name_='domain')
19681 for registry_ in self.registry:
19682 registry_.export(outfile, level, namespace_, name_='registry')
19683 for ip_ in self.ip:
19684 ip_.export(outfile, level, namespace_, name_='ip')
19685 for asn_ in self.asn:
19686 asn_.export(outfile, level, namespace_, name_='asn')
19687 for entity_ in self.entity:
19688 entity_.export(outfile, level, namespace_, name_='entity')
19689 for classification_ in self.classification:
19690 classification_.export(outfile, level, namespace_, name_='classification')
19691 - def hasContent_(self):
19692 if (
19693 self.file or
19694 self.uri or
19695 self.domain or
19696 self.registry or
19697 self.ip or
19698 self.asn or
19699 self.entity or
19700 self.classification
19701 ):
19702 return True
19703 else:
19704 return False
19713 showIndent(outfile, level)
19714 outfile.write('file=[\n')
19715 level += 1
19716 for file_ in self.file:
19717 showIndent(outfile, level)
19718 outfile.write('model_.fileObject(\n')
19719 file_.exportLiteral(outfile, level, name_='fileObject')
19720 showIndent(outfile, level)
19721 outfile.write('),\n')
19722 level -= 1
19723 showIndent(outfile, level)
19724 outfile.write('],\n')
19725 showIndent(outfile, level)
19726 outfile.write('uri=[\n')
19727 level += 1
19728 for uri_ in self.uri:
19729 showIndent(outfile, level)
19730 outfile.write('model_.uriObject(\n')
19731 uri_.exportLiteral(outfile, level, name_='uriObject')
19732 showIndent(outfile, level)
19733 outfile.write('),\n')
19734 level -= 1
19735 showIndent(outfile, level)
19736 outfile.write('],\n')
19737 showIndent(outfile, level)
19738 outfile.write('domain=[\n')
19739 level += 1
19740 for domain_ in self.domain:
19741 showIndent(outfile, level)
19742 outfile.write('model_.domainObject(\n')
19743 domain_.exportLiteral(outfile, level, name_='domainObject')
19744 showIndent(outfile, level)
19745 outfile.write('),\n')
19746 level -= 1
19747 showIndent(outfile, level)
19748 outfile.write('],\n')
19749 showIndent(outfile, level)
19750 outfile.write('registry=[\n')
19751 level += 1
19752 for registry_ in self.registry:
19753 showIndent(outfile, level)
19754 outfile.write('model_.registryObject(\n')
19755 registry_.exportLiteral(outfile, level, name_='registryObject')
19756 showIndent(outfile, level)
19757 outfile.write('),\n')
19758 level -= 1
19759 showIndent(outfile, level)
19760 outfile.write('],\n')
19761 showIndent(outfile, level)
19762 outfile.write('ip=[\n')
19763 level += 1
19764 for ip_ in self.ip:
19765 showIndent(outfile, level)
19766 outfile.write('model_.IPObject(\n')
19767 ip_.exportLiteral(outfile, level, name_='IPObject')
19768 showIndent(outfile, level)
19769 outfile.write('),\n')
19770 level -= 1
19771 showIndent(outfile, level)
19772 outfile.write('],\n')
19773 showIndent(outfile, level)
19774 outfile.write('asn=[\n')
19775 level += 1
19776 for asn_ in self.asn:
19777 showIndent(outfile, level)
19778 outfile.write('model_.ASNObject(\n')
19779 asn_.exportLiteral(outfile, level, name_='ASNObject')
19780 showIndent(outfile, level)
19781 outfile.write('),\n')
19782 level -= 1
19783 showIndent(outfile, level)
19784 outfile.write('],\n')
19785 showIndent(outfile, level)
19786 outfile.write('entity=[\n')
19787 level += 1
19788 for entity_ in self.entity:
19789 showIndent(outfile, level)
19790 outfile.write('model_.entityObject(\n')
19791 entity_.exportLiteral(outfile, level, name_='entityObject')
19792 showIndent(outfile, level)
19793 outfile.write('),\n')
19794 level -= 1
19795 showIndent(outfile, level)
19796 outfile.write('],\n')
19797 showIndent(outfile, level)
19798 outfile.write('classification=[\n')
19799 level += 1
19800 for classification_ in self.classification:
19801 showIndent(outfile, level)
19802 outfile.write('model_.classificationObject(\n')
19803 classification_.exportLiteral(outfile, level, name_='classificationObject')
19804 showIndent(outfile, level)
19805 outfile.write('),\n')
19806 level -= 1
19807 showIndent(outfile, level)
19808 outfile.write('],\n')
19809 - def build(self, node):
19816 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
19817 if nodeName_ == 'file':
19818 obj_ = fileObject.factory()
19819 obj_.build(child_)
19820 self.file.append(obj_)
19821 elif nodeName_ == 'uri':
19822 obj_ = uriObject.factory()
19823 obj_.build(child_)
19824 self.uri.append(obj_)
19825 elif nodeName_ == 'domain':
19826 obj_ = domainObject.factory()
19827 obj_.build(child_)
19828 self.domain.append(obj_)
19829 elif nodeName_ == 'registry':
19830 obj_ = registryObject.factory()
19831 obj_.build(child_)
19832 self.registry.append(obj_)
19833 elif nodeName_ == 'ip':
19834 obj_ = IPObject.factory()
19835 obj_.build(child_)
19836 self.ip.append(obj_)
19837 elif nodeName_ == 'asn':
19838 obj_ = ASNObject.factory()
19839 obj_.build(child_)
19840 self.asn.append(obj_)
19841 elif nodeName_ == 'entity':
19842 obj_ = entityObject.factory()
19843 obj_.build(child_)
19844 self.entity.append(obj_)
19845 elif nodeName_ == 'classification':
19846 obj_ = classificationObject.factory()
19847 obj_.build(child_)
19848 self.classification.append(obj_)
19849
19850
19851
19853 subclass = None
19854 superclass = None
19855 - def __init__(self, objectProperty=None):
19865 factory = staticmethod(factory)
19870 - def export(self, outfile, level, namespace_='maec:', name_='objectPropertiesType', namespacedef_=''):
19871 showIndent(outfile, level)
19872 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
19873 already_processed = []
19874 self.exportAttributes(outfile, level, already_processed, namespace_, name_='objectPropertiesType')
19875 if self.hasContent_():
19876 outfile.write('>\n')
19877 self.exportChildren(outfile, level + 1, namespace_, name_)
19878 showIndent(outfile, level)
19879 outfile.write('</%s%s>\n' % (namespace_, name_))
19880 else:
19881 outfile.write('/>\n')
19882 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='objectPropertiesType'):
19884 - def exportChildren(self, outfile, level, namespace_='maec:', name_='objectPropertiesType', fromsubclass_=False):
19885 for objectProperty_ in self.objectProperty:
19886 objectProperty_.export(outfile, level, namespace_, name_='objectProperty')
19887 - def hasContent_(self):
19888 if (
19889 self.objectProperty
19890 ):
19891 return True
19892 else:
19893 return False
19894 - def exportLiteral(self, outfile, level, name_='objectPropertiesType'):
19902 showIndent(outfile, level)
19903 outfile.write('objectProperty=[\n')
19904 level += 1
19905 for objectProperty_ in self.objectProperty:
19906 showIndent(outfile, level)
19907 outfile.write('model_.objectProperty(\n')
19908 objectProperty_.exportLiteral(outfile, level)
19909 showIndent(outfile, level)
19910 outfile.write('),\n')
19911 level -= 1
19912 showIndent(outfile, level)
19913 outfile.write('],\n')
19914 - def build(self, node):
19921 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
19926
19927
19928
19930 subclass = None
19931 superclass = None
19932 - def __init__(self, relationship=None):
19942 factory = staticmethod(factory)
19947 - def export(self, outfile, level, namespace_='maec:', name_='relationshipsType', namespacedef_=''):
19948 showIndent(outfile, level)
19949 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
19950 already_processed = []
19951 self.exportAttributes(outfile, level, already_processed, namespace_, name_='relationshipsType')
19952 if self.hasContent_():
19953 outfile.write('>\n')
19954 self.exportChildren(outfile, level + 1, namespace_, name_)
19955 showIndent(outfile, level)
19956 outfile.write('</%s%s>\n' % (namespace_, name_))
19957 else:
19958 outfile.write('/>\n')
19959 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='relationshipsType'):
19961 - def exportChildren(self, outfile, level, namespace_='maec:', name_='relationshipsType', fromsubclass_=False):
19962 for relationship_ in self.relationship:
19963 relationship_.export(outfile, level, namespace_, name_='relationship')
19964 - def hasContent_(self):
19965 if (
19966 self.relationship
19967 ):
19968 return True
19969 else:
19970 return False
19971 - def exportLiteral(self, outfile, level, name_='relationshipsType'):
19979 showIndent(outfile, level)
19980 outfile.write('relationship=[\n')
19981 level += 1
19982 for relationship_ in self.relationship:
19983 showIndent(outfile, level)
19984 outfile.write('model_.relationship(\n')
19985 relationship_.exportLiteral(outfile, level)
19986 showIndent(outfile, level)
19987 outfile.write('),\n')
19988 level -= 1
19989 showIndent(outfile, level)
19990 outfile.write('],\n')
19991 - def build(self, node):
19998 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
20003
20004
20005
20007 subclass = None
20008 superclass = None
20009 - def __init__(self, fieldDataEntry=None):
20019 factory = staticmethod(factory)
20022 - def add_fieldDataEntry(self, value): self.fieldDataEntry.append(value)
20023 - def insert_fieldDataEntry(self, index, value): self.fieldDataEntry[index] = value
20024 - def export(self, outfile, level, namespace_='maec:', name_='fieldDataType', namespacedef_=''):
20025 showIndent(outfile, level)
20026 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
20027 already_processed = []
20028 self.exportAttributes(outfile, level, already_processed, namespace_, name_='fieldDataType')
20029 if self.hasContent_():
20030 outfile.write('>\n')
20031 self.exportChildren(outfile, level + 1, namespace_, name_)
20032 showIndent(outfile, level)
20033 outfile.write('</%s%s>\n' % (namespace_, name_))
20034 else:
20035 outfile.write('/>\n')
20036 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='fieldDataType'):
20038 - def exportChildren(self, outfile, level, namespace_='maec:', name_='fieldDataType', fromsubclass_=False):
20039 for fieldDataEntry_ in self.fieldDataEntry:
20040 fieldDataEntry_.export(outfile, level, namespace_, name_='fieldDataEntry')
20041 - def hasContent_(self):
20042 if (
20043 self.fieldDataEntry
20044 ):
20045 return True
20046 else:
20047 return False
20048 - def exportLiteral(self, outfile, level, name_='fieldDataType'):
20056 showIndent(outfile, level)
20057 outfile.write('fieldDataEntry=[\n')
20058 level += 1
20059 for fieldDataEntry_ in self.fieldDataEntry:
20060 showIndent(outfile, level)
20061 outfile.write('model_.fieldDataEntry(\n')
20062 fieldDataEntry_.exportLiteral(outfile, level)
20063 showIndent(outfile, level)
20064 outfile.write('),\n')
20065 level -= 1
20066 showIndent(outfile, level)
20067 outfile.write('],\n')
20068 - def build(self, node):
20075 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
20080
20081
20082
20084 subclass = None
20085 superclass = None
20087 self.type_ = _cast(None, type_)
20088 self.valueOf_ = valueOf_
20094 factory = staticmethod(factory)
20100 showIndent(outfile, level)
20101 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
20102 already_processed = []
20103 self.exportAttributes(outfile, level, already_processed, namespace_, name_='extraHashType')
20104 if self.hasContent_():
20105 outfile.write('>')
20106 outfile.write(str(self.valueOf_).encode(ExternalEncoding))
20107 self.exportChildren(outfile, level + 1, namespace_, name_)
20108 outfile.write('</%s%s>\n' % (namespace_, name_))
20109 else:
20110 outfile.write('/>\n')
20112 if self.type_ is not None and 'type_' not in already_processed:
20113 already_processed.append('type_')
20114 outfile.write(' type=%s' % (self.gds_format_string(quote_attrib(self.type_).encode(ExternalEncoding), input_name='type'), ))
20118 if (
20119 self.valueOf_
20120 ):
20121 return True
20122 else:
20123 return False
20132 if self.type_ is not None and 'type_' not in already_processed:
20133 already_processed.append('type_')
20134 showIndent(outfile, level)
20135 outfile.write('type_ = "%s",\n' % (self.type_,))
20145 value = find_attr_value_('type', node)
20146 if value is not None and 'type' not in already_processed:
20147 already_processed.append('type')
20148 self.type_ = value
20151
20152
20153
20155 subclass = None
20156 superclass = None
20157 - def __init__(self, definitionVersion=None, detectionAddedTimeStamp=None, detectionShippedTimeStamp=None, product=None, productVersion=None):
20158 self.definitionVersion = definitionVersion
20159 self.detectionAddedTimeStamp = detectionAddedTimeStamp
20160 self.detectionShippedTimeStamp = detectionShippedTimeStamp
20161 self.product = product
20162 self.productVersion = productVersion
20168 factory = staticmethod(factory)
20176 - def set_product(self, product): self.product = product
20179 - def export(self, outfile, level, namespace_='maec:', name_='classificationDetailsType', namespacedef_=''):
20180 showIndent(outfile, level)
20181 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
20182 already_processed = []
20183 self.exportAttributes(outfile, level, already_processed, namespace_, name_='classificationDetailsType')
20184 if self.hasContent_():
20185 outfile.write('>\n')
20186 self.exportChildren(outfile, level + 1, namespace_, name_)
20187 showIndent(outfile, level)
20188 outfile.write('</%s%s>\n' % (namespace_, name_))
20189 else:
20190 outfile.write('/>\n')
20191 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='classificationDetailsType'):
20193 - def exportChildren(self, outfile, level, namespace_='maec:', name_='classificationDetailsType', fromsubclass_=False):
20194 if self.definitionVersion is not None:
20195 showIndent(outfile, level)
20196 outfile.write('<%sdefinitionVersion>%s</%sdefinitionVersion>\n' % (namespace_, self.gds_format_string(quote_xml(self.definitionVersion).encode(ExternalEncoding), input_name='definitionVersion'), namespace_))
20197 if self.detectionAddedTimeStamp is not None:
20198 showIndent(outfile, level)
20199 outfile.write('<%sdetectionAddedTimeStamp>%s</%sdetectionAddedTimeStamp>\n' % (namespace_, self.gds_format_string(quote_xml(self.detectionAddedTimeStamp).encode(ExternalEncoding), input_name='detectionAddedTimeStamp'), namespace_))
20200 if self.detectionShippedTimeStamp is not None:
20201 showIndent(outfile, level)
20202 outfile.write('<%sdetectionShippedTimeStamp>%s</%sdetectionShippedTimeStamp>\n' % (namespace_, self.gds_format_string(quote_xml(self.detectionShippedTimeStamp).encode(ExternalEncoding), input_name='detectionShippedTimeStamp'), namespace_))
20203 if self.product is not None:
20204 showIndent(outfile, level)
20205 outfile.write('<%sproduct>%s</%sproduct>\n' % (namespace_, self.gds_format_string(quote_xml(self.product).encode(ExternalEncoding), input_name='product'), namespace_))
20206 if self.productVersion is not None:
20207 showIndent(outfile, level)
20208 outfile.write('<%sproductVersion>%s</%sproductVersion>\n' % (namespace_, self.gds_format_string(quote_xml(self.productVersion).encode(ExternalEncoding), input_name='productVersion'), namespace_))
20209 - def hasContent_(self):
20210 if (
20211 self.definitionVersion is not None or
20212 self.detectionAddedTimeStamp is not None or
20213 self.detectionShippedTimeStamp is not None or
20214 self.product is not None or
20215 self.productVersion is not None
20216 ):
20217 return True
20218 else:
20219 return False
20220 - def exportLiteral(self, outfile, level, name_='classificationDetailsType'):
20228 if self.definitionVersion is not None:
20229 showIndent(outfile, level)
20230 outfile.write('definitionVersion=%s,\n' % quote_python(self.definitionVersion).encode(ExternalEncoding))
20231 if self.detectionAddedTimeStamp is not None:
20232 showIndent(outfile, level)
20233 outfile.write('detectionAddedTimeStamp=%s,\n' % quote_python(self.detectionAddedTimeStamp).encode(ExternalEncoding))
20234 if self.detectionShippedTimeStamp is not None:
20235 showIndent(outfile, level)
20236 outfile.write('detectionShippedTimeStamp=%s,\n' % quote_python(self.detectionShippedTimeStamp).encode(ExternalEncoding))
20237 if self.product is not None:
20238 showIndent(outfile, level)
20239 outfile.write('product=%s,\n' % quote_python(self.product).encode(ExternalEncoding))
20240 if self.productVersion is not None:
20241 showIndent(outfile, level)
20242 outfile.write('productVersion=%s,\n' % quote_python(self.productVersion).encode(ExternalEncoding))
20243 - def build(self, node):
20250 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
20251 if nodeName_ == 'definitionVersion':
20252 definitionVersion_ = child_.text
20253 definitionVersion_ = self.gds_validate_string(definitionVersion_, node, 'definitionVersion')
20254 self.definitionVersion = definitionVersion_
20255 elif nodeName_ == 'detectionAddedTimeStamp':
20256 detectionAddedTimeStamp_ = child_.text
20257 detectionAddedTimeStamp_ = self.gds_validate_string(detectionAddedTimeStamp_, node, 'detectionAddedTimeStamp')
20258 self.detectionAddedTimeStamp = detectionAddedTimeStamp_
20259 elif nodeName_ == 'detectionShippedTimeStamp':
20260 detectionShippedTimeStamp_ = child_.text
20261 detectionShippedTimeStamp_ = self.gds_validate_string(detectionShippedTimeStamp_, node, 'detectionShippedTimeStamp')
20262 self.detectionShippedTimeStamp = detectionShippedTimeStamp_
20263 elif nodeName_ == 'product':
20264 product_ = child_.text
20265 product_ = self.gds_validate_string(product_, node, 'product')
20266 self.product = product_
20267 elif nodeName_ == 'productVersion':
20268 productVersion_ = child_.text
20269 productVersion_ = self.gds_validate_string(productVersion_, node, 'productVersion')
20270 self.productVersion = productVersion_
20271
20272
20273
20275 subclass = None
20276 superclass = None
20278 if ref is None:
20279 self.ref = []
20280 else:
20281 self.ref = ref
20287 factory = staticmethod(factory)
20288 - def get_ref(self): return self.ref
20289 - def set_ref(self, ref): self.ref = ref
20290 - def add_ref(self, value): self.ref.append(value)
20291 - def insert_ref(self, index, value): self.ref[index] = value
20292 - def export(self, outfile, level, namespace_='maec:', name_='referencesType', namespacedef_=''):
20293 showIndent(outfile, level)
20294 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
20295 already_processed = []
20296 self.exportAttributes(outfile, level, already_processed, namespace_, name_='referencesType')
20297 if self.hasContent_():
20298 outfile.write('>\n')
20299 self.exportChildren(outfile, level + 1, namespace_, name_)
20300 showIndent(outfile, level)
20301 outfile.write('</%s%s>\n' % (namespace_, name_))
20302 else:
20303 outfile.write('/>\n')
20304 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='referencesType'):
20306 - def exportChildren(self, outfile, level, namespace_='maec:', name_='referencesType', fromsubclass_=False):
20307 for ref_ in self.ref:
20308 ref_.export(outfile, level, namespace_, name_='ref')
20309 - def hasContent_(self):
20310 if (
20311 self.ref
20312 ):
20313 return True
20314 else:
20315 return False
20316 - def exportLiteral(self, outfile, level, name_='referencesType'):
20324 showIndent(outfile, level)
20325 outfile.write('ref=[\n')
20326 level += 1
20327 for ref_ in self.ref:
20328 showIndent(outfile, level)
20329 outfile.write('model_.reference(\n')
20330 ref_.exportLiteral(outfile, level, name_='reference')
20331 showIndent(outfile, level)
20332 outfile.write('),\n')
20333 level -= 1
20334 showIndent(outfile, level)
20335 outfile.write('],\n')
20336 - def build(self, node):
20343 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
20344 if nodeName_ == 'ref':
20345 obj_ = reference.factory()
20346 obj_.build(child_)
20347 self.ref.append(obj_)
20348
20349
20350
20352 subclass = None
20353 superclass = None
20354 - def __init__(self, units=None, valueOf_=None):
20355 self.units = _cast(None, units)
20356 self.valueOf_ = valueOf_
20362 factory = staticmethod(factory)
20364 - def set_units(self, units): self.units = units
20369 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
20370 - def export(self, outfile, level, namespace_='maec:', name_='volumeType', namespacedef_=''):
20371 showIndent(outfile, level)
20372 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
20373 already_processed = []
20374 self.exportAttributes(outfile, level, already_processed, namespace_, name_='volumeType')
20375 if self.hasContent_():
20376 outfile.write('>')
20377 outfile.write(str(self.valueOf_).encode(ExternalEncoding))
20378 self.exportChildren(outfile, level + 1, namespace_, name_)
20379 outfile.write('</%s%s>\n' % (namespace_, name_))
20380 else:
20381 outfile.write('/>\n')
20382 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='volumeType'):
20383 if self.units is not None and 'units' not in already_processed:
20384 already_processed.append('units')
20385 outfile.write(' units=%s' % (quote_attrib(self.units), ))
20386 - def exportChildren(self, outfile, level, namespace_='maec:', name_='volumeType', fromsubclass_=False):
20388 - def hasContent_(self):
20389 if (
20390 self.valueOf_
20391 ):
20392 return True
20393 else:
20394 return False
20403 if self.units is not None and 'units' not in already_processed:
20404 already_processed.append('units')
20405 showIndent(outfile, level)
20406 outfile.write('units = "%s",\n' % (self.units,))
20409 - def build(self, node):
20416 value = find_attr_value_('units', node)
20417 if value is not None and 'units' not in already_processed:
20418 already_processed.append('units')
20419 self.units = value
20420 self.validate_VolumeUnitsEnum(self.units)
20421 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
20423
20424
20425
20427 subclass = None
20428 superclass = None
20429 - def __init__(self, type_=None, valueOf_=None):
20430 self.type_ = _cast(None, type_)
20431 self.valueOf_ = valueOf_
20437 factory = staticmethod(factory)
20438 - def get_type(self): return self.type_
20439 - def set_type(self, type_): self.type_ = type_
20444 - def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
20445 - def export(self, outfile, level, namespace_='maec:', name_='locationType', namespacedef_=''):
20446 showIndent(outfile, level)
20447 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
20448 already_processed = []
20449 self.exportAttributes(outfile, level, already_processed, namespace_, name_='locationType')
20450 if self.hasContent_():
20451 outfile.write('>')
20452 outfile.write(str(self.valueOf_).encode(ExternalEncoding))
20453 self.exportChildren(outfile, level + 1, namespace_, name_)
20454 outfile.write('</%s%s>\n' % (namespace_, name_))
20455 else:
20456 outfile.write('/>\n')
20457 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='locationType'):
20458 if self.type_ is not None and 'type_' not in already_processed:
20459 already_processed.append('type_')
20460 outfile.write(' type=%s' % (quote_attrib(self.type_), ))
20461 - def exportChildren(self, outfile, level, namespace_='maec:', name_='locationType', fromsubclass_=False):
20463 - def hasContent_(self):
20464 if (
20465 self.valueOf_
20466 ):
20467 return True
20468 else:
20469 return False
20470 - def exportLiteral(self, outfile, level, name_='locationType'):
20478 if self.type_ is not None and 'type_' not in already_processed:
20479 already_processed.append('type_')
20480 showIndent(outfile, level)
20481 outfile.write('type_ = "%s",\n' % (self.type_,))
20484 - def build(self, node):
20491 value = find_attr_value_('type', node)
20492 if value is not None and 'type' not in already_processed:
20493 already_processed.append('type')
20494 self.type_ = value
20495 self.validate_LocationTypeEnum(self.type_)
20496 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
20498
20499
20500
20502 subclass = None
20503 superclass = None
20505 if ref is None:
20506 self.ref = []
20507 else:
20508 self.ref = ref
20514 factory = staticmethod(factory)
20515 - def get_ref(self): return self.ref
20516 - def set_ref(self, ref): self.ref = ref
20517 - def add_ref(self, value): self.ref.append(value)
20518 - def insert_ref(self, index, value): self.ref[index] = value
20519 - def export(self, outfile, level, namespace_='maec:', name_='referencesType1', namespacedef_=''):
20520 showIndent(outfile, level)
20521 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
20522 already_processed = []
20523 self.exportAttributes(outfile, level, already_processed, namespace_, name_='referencesType1')
20524 if self.hasContent_():
20525 outfile.write('>\n')
20526 self.exportChildren(outfile, level + 1, namespace_, name_)
20527 showIndent(outfile, level)
20528 outfile.write('</%s%s>\n' % (namespace_, name_))
20529 else:
20530 outfile.write('/>\n')
20531 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='referencesType1'):
20533 - def exportChildren(self, outfile, level, namespace_='maec:', name_='referencesType1', fromsubclass_=False):
20534 for ref_ in self.ref:
20535 ref_.export(outfile, level, namespace_, name_='ref')
20536 - def hasContent_(self):
20537 if (
20538 self.ref
20539 ):
20540 return True
20541 else:
20542 return False
20543 - def exportLiteral(self, outfile, level, name_='referencesType1'):
20551 showIndent(outfile, level)
20552 outfile.write('ref=[\n')
20553 level += 1
20554 for ref_ in self.ref:
20555 showIndent(outfile, level)
20556 outfile.write('model_.reference(\n')
20557 ref_.exportLiteral(outfile, level, name_='reference')
20558 showIndent(outfile, level)
20559 outfile.write('),\n')
20560 level -= 1
20561 showIndent(outfile, level)
20562 outfile.write('],\n')
20563 - def build(self, node):
20570 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
20571 if nodeName_ == 'ref':
20572 obj_ = reference.factory()
20573 obj_.build(child_)
20574 self.ref.append(obj_)
20575
20576
20577
20579 subclass = None
20580 superclass = None
20582 if ref is None:
20583 self.ref = []
20584 else:
20585 self.ref = ref
20591 factory = staticmethod(factory)
20592 - def get_ref(self): return self.ref
20593 - def set_ref(self, ref): self.ref = ref
20594 - def add_ref(self, value): self.ref.append(value)
20595 - def insert_ref(self, index, value): self.ref[index] = value
20596 - def export(self, outfile, level, namespace_='maec:', name_='sourceType', namespacedef_=''):
20597 showIndent(outfile, level)
20598 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
20599 already_processed = []
20600 self.exportAttributes(outfile, level, already_processed, namespace_, name_='sourceType')
20601 if self.hasContent_():
20602 outfile.write('>\n')
20603 self.exportChildren(outfile, level + 1, namespace_, name_)
20604 showIndent(outfile, level)
20605 outfile.write('</%s%s>\n' % (namespace_, name_))
20606 else:
20607 outfile.write('/>\n')
20608 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='sourceType'):
20610 - def exportChildren(self, outfile, level, namespace_='maec:', name_='sourceType', fromsubclass_=False):
20611 for ref_ in self.ref:
20612 ref_.export(outfile, level, namespace_, name_='ref')
20613 - def hasContent_(self):
20614 if (
20615 self.ref
20616 ):
20617 return True
20618 else:
20619 return False
20628 showIndent(outfile, level)
20629 outfile.write('ref=[\n')
20630 level += 1
20631 for ref_ in self.ref:
20632 showIndent(outfile, level)
20633 outfile.write('model_.reference(\n')
20634 ref_.exportLiteral(outfile, level, name_='reference')
20635 showIndent(outfile, level)
20636 outfile.write('),\n')
20637 level -= 1
20638 showIndent(outfile, level)
20639 outfile.write('],\n')
20640 - def build(self, node):
20647 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
20648 if nodeName_ == 'ref':
20649 obj_ = reference.factory()
20650 obj_.build(child_)
20651 self.ref.append(obj_)
20652
20653
20654
20656 subclass = None
20657 superclass = None
20659 if ref is None:
20660 self.ref = []
20661 else:
20662 self.ref = ref
20668 factory = staticmethod(factory)
20669 - def get_ref(self): return self.ref
20670 - def set_ref(self, ref): self.ref = ref
20671 - def add_ref(self, value): self.ref.append(value)
20672 - def insert_ref(self, index, value): self.ref[index] = value
20673 - def export(self, outfile, level, namespace_='maec:', name_='targetType', namespacedef_=''):
20674 showIndent(outfile, level)
20675 outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
20676 already_processed = []
20677 self.exportAttributes(outfile, level, already_processed, namespace_, name_='targetType')
20678 if self.hasContent_():
20679 outfile.write('>\n')
20680 self.exportChildren(outfile, level + 1, namespace_, name_)
20681 showIndent(outfile, level)
20682 outfile.write('</%s%s>\n' % (namespace_, name_))
20683 else:
20684 outfile.write('/>\n')
20685 - def exportAttributes(self, outfile, level, already_processed, namespace_='maec:', name_='targetType'):
20687 - def exportChildren(self, outfile, level, namespace_='maec:', name_='targetType', fromsubclass_=False):
20688 for ref_ in self.ref:
20689 ref_.export(outfile, level, namespace_, name_='ref')
20690 - def hasContent_(self):
20691 if (
20692 self.ref
20693 ):
20694 return True
20695 else:
20696 return False
20705 showIndent(outfile, level)
20706 outfile.write('ref=[\n')
20707 level += 1
20708 for ref_ in self.ref:
20709 showIndent(outfile, level)
20710 outfile.write('model_.reference(\n')
20711 ref_.exportLiteral(outfile, level, name_='reference')
20712 showIndent(outfile, level)
20713 outfile.write('),\n')
20714 level -= 1
20715 showIndent(outfile, level)
20716 outfile.write('],\n')
20717 - def build(self, node):
20724 - def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
20725 if nodeName_ == 'ref':
20726 obj_ = reference.factory()
20727 obj_.build(child_)
20728 self.ref.append(obj_)
20729
20730
20731
20732 USAGE_TEXT = """
20733 Usage: python <Parser>.py [ -s ] <in_xml_file>
20734 """
20735
20739
20740
20742 tag = Tag_pattern_.match(node.tag).groups()[-1]
20743 rootClass = globals().get(tag)
20744 return tag, rootClass
20745
20746
20748 doc = parsexml_(inFileName)
20749 rootNode = doc.getroot()
20750 rootTag, rootClass = get_root_tag(rootNode)
20751 if rootClass is None:
20752 rootTag = 'MAEC_Bundle'
20753 rootClass = BundleType
20754 rootObj = rootClass.factory()
20755 rootObj.build(rootNode)
20756
20757 doc = None
20758 sys.stdout.write('<?xml version="1.0" ?>\n')
20759 rootObj.export(sys.stdout, 0, name_=rootTag,
20760 namespacedef_='')
20761 return rootObj
20762
20763
20765 from StringIO import StringIO
20766 doc = parsexml_(StringIO(inString))
20767 rootNode = doc.getroot()
20768 rootTag, rootClass = get_root_tag(rootNode)
20769 if rootClass is None:
20770 rootTag = 'MAEC_Bundle'
20771 rootClass = BundleType
20772 rootObj = rootClass.factory()
20773 rootObj.build(rootNode)
20774
20775 doc = None
20776 sys.stdout.write('<?xml version="1.0" ?>\n')
20777 rootObj.export(sys.stdout, 0, name_="MAEC_Bundle",
20778 namespacedef_='')
20779 return rootObj
20780
20781
20783 doc = parsexml_(inFileName)
20784 rootNode = doc.getroot()
20785 rootTag, rootClass = get_root_tag(rootNode)
20786 if rootClass is None:
20787 rootTag = 'MAEC_Bundle'
20788 rootClass = BundleType
20789 rootObj = rootClass.factory()
20790 rootObj.build(rootNode)
20791
20792 doc = None
20793 sys.stdout.write('#from maec import *\n\n')
20794 sys.stdout.write('import maec as model_\n\n')
20795 sys.stdout.write('rootObj = model_.rootTag(\n')
20796 rootObj.exportLiteral(sys.stdout, 0, name_=rootTag)
20797 sys.stdout.write(')\n')
20798 return rootObj
20799
20800
20802 args = sys.argv[1:]
20803 if len(args) == 1:
20804 parse(args[0])
20805 else:
20806 usage()
20807
20808
20809 if __name__ == '__main__':
20810
20811 main()
20812
20813
20814 __all__ = [
20815 "APICallType",
20816 "APICall_ParameterType",
20817 "ASNObject",
20818 "ActionCollectionType",
20819 "ActionImplementationType",
20820 "ActionReferenceType",
20821 "ActionType",
20822 "Action_Collection_PoolType",
20823 "Action_InitiatorType",
20824 "Action_PoolType",
20825 "ActionsType",
20826 "ActionsType1",
20827 "Affected_ObjectType",
20828 "Affected_ObjectsType",
20829 "AnalysesType",
20830 "AnalysisType",
20831 "Analysis_EnvironmentType",
20832 "AnalystsType",
20833 "Associated_CodeType",
20834 "Associated_Code_SnippetType",
20835 "Attempted_Vulnerability_ExploitType",
20836 "BehaviorCollectionType",
20837 "BehaviorReferenceType",
20838 "BehaviorType",
20839 "Behavior_Collection_PoolType",
20840 "Behavior_PoolType",
20841 "BehaviorsType",
20842 "Block",
20843 "BundleType",
20844 "CPESpecificationType",
20845 "CVEVulnerabilityType",
20846 "CertificateType",
20847 "Child_ProcessesType",
20848 "ClassificationsType",
20849 "CodeType",
20850 "Constituent_EffectsType",
20851 "Custom_AttributeType",
20852 "Custom_Object_AttributesType",
20853 "DOS_HeaderType",
20854 "Daemon_Action_AttributesType",
20855 "Daemon_Object_AttributesType",
20856 "DataType",
20857 "Data_DirectoryType",
20858 "Data_HashesType",
20859 "Data_SizeType",
20860 "Digital_CertificatesType",
20861 "DiscoveryMethod",
20862 "EffectCollectionType",
20863 "EffectReferenceType",
20864 "EffectType",
20865 "Effect_PoolType",
20866 "EffectsType",
20867 "EffectsType1",
20868 "EffectsType2",
20869 "EffectsType3",
20870 "Enivironment_VariablesType",
20871 "Enumerated_DaemonsType",
20872 "Environment_VariableType",
20873 "Event_Type",
20874 "ExportsType",
20875 "File_HeaderType",
20876 "File_System_Action_AttributesType",
20877 "File_System_Object_AttributesType",
20878 "File_TypeType",
20879 "File_Type_AttributesType",
20880 "GUI_Object_AttributesType",
20881 "HandleType",
20882 "HandlesType",
20883 "HashType",
20884 "HashesType",
20885 "HashesType1",
20886 "HashesType2",
20887 "HashesType3",
20888 "HashesType4",
20889 "HashesType5",
20890 "HashesType6",
20891 "HashesType7",
20892 "Header_HashesType",
20893 "HeadersType",
20894 "IPAddress",
20895 "IPC_Action_AttributesType",
20896 "IPC_Object_AttributesType",
20897 "IPObject",
20898 "ImageType",
20899 "ImageType1",
20900 "ImageType2",
20901 "ImagesType",
20902 "ImagesType1",
20903 "ImagesType2",
20904 "Imported_FunctionType",
20905 "Imported_FunctionsType",
20906 "ImportsType",
20907 "Internet_Action_AttributesType",
20908 "Internet_Object_AttributesType",
20909 "Library_Type",
20910 "Memory_Action_AttributesType",
20911 "Memory_Object_AttributesType",
20912 "Module_Action_AttributesType",
20913 "Module_Object_AttributesType",
20914 "Nature_Of_Relationship",
20915 "Nature_of_Relationship",
20916 "Network_Action_AttributesType",
20917 "Network_Object_AttributesType",
20918 "NotesType",
20919 "ObjectCollectionType",
20920 "ObjectReferenceType",
20921 "ObjectType",
20922 "Object_Collection_PoolType",
20923 "Object_PoolType",
20924 "Object_SizeType",
20925 "ObjectsType",
20926 "ObjectsType1",
20927 "Optional_HeaderType",
20928 "PEDataDirectoryStruct",
20929 "PEExportType",
20930 "PEImportType",
20931 "PEResourceType",
20932 "PESectionHeaderStruct",
20933 "PESectionType",
20934 "PEStringType",
20935 "PE_Binary_AttributesType",
20936 "PE_HeaderType",
20937 "Packer_TypeType",
20938 "PackingType",
20939 "PathType",
20940 "PoolsType",
20941 "Process_Action_AttributesType",
20942 "Process_Object_AttributesType",
20943 "PurposeType",
20944 "Registry_Action_AttributesType",
20945 "Registry_Object_AttributesType",
20946 "Related_ActionType",
20947 "Related_ActionsType",
20948 "Related_BehaviorType",
20949 "Related_BehaviorsType",
20950 "Related_ObjectType",
20951 "Related_ObjectsType",
20952 "ResourcesType",
20953 "Section_TableType",
20954 "SectionsType",
20955 "Service_Type",
20956 "Socket_Type",
20957 "SourceType",
20958 "StringsType",
20959 "StructuredTextType",
20960 "SubjectType",
20961 "System_Action_AttributesType",
20962 "TitleType",
20963 "ToolType",
20964 "Tools_UsedType",
20965 "TrID_TypeType",
20966 "ValueType",
20967 "Version_BlockType",
20968 "Vulnerability_ExploitType",
20969 "classificationDetailsType",
20970 "classificationObject",
20971 "domainObject",
20972 "entityObject",
20973 "extraHashType",
20974 "fieldDataEntry",
20975 "fieldDataType",
20976 "fileObject",
20977 "locationType",
20978 "malwareMetaData",
20979 "meta_item_metadataType",
20980 "objectPropertiesType",
20981 "objectProperty",
20982 "objectsType",
20983 "property",
20984 "reference",
20985 "referencesType",
20986 "referencesType1",
20987 "registryObject",
20988 "relationship",
20989 "relationshipsType",
20990 "sourceType",
20991 "targetType",
20992 "uriObject",
20993 "volumeType"
20994 ]
20995